美文网首页
Odin Inspector 系列教程 --- Table Co

Odin Inspector 系列教程 --- Table Co

作者: su9257_海澜 | 来源:发表于2019-10-10 10:13 被阅读0次

TableColumnWidth属性用于进一步自定义使用“ TableListAttribute” 绘制的表中的列的宽度。

【Resizable】 控制是否自动调整大小
using Sirenix.OdinInspector;
using Sirenix.Utilities.Editor;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TableColumnWidthAttributeExample : MonoBehaviour
{
    [TableList]
    public List<MyItem> List = new List<MyItem>()
{
    new MyItem(),
    new MyItem(),
    new MyItem(),
};

    [Serializable]
    public class MyItem
    {
        [PreviewField(Height = 20)]
        [TableColumnWidth(30, Resizable = false)]
        public Texture2D Icon;

        [TableColumnWidth(60)]
        public int ID;
        [TableColumnWidth(100)]
        public string Name;
    }
}

更多教程内容详见:革命性Unity 编辑器扩展工具 --- Odin Inspector 系列教程

相关文章

网友评论

      本文标题:Odin Inspector 系列教程 --- Table Co

      本文链接:https://www.haomeiwen.com/subject/yvxipctx.html