Odin Inspector 系列教程 --- Enable G

2021-11-24  本文已影响0人  忆中异

Enable GUIAttribute特性:可以控制只有Get的属性,在Inspector中是否为可灰态的(但是依然不可编辑),不写则默认为灰态。

image
完整示例代码
using Sirenix.OdinInspector;
using UnityEngine;

public class EnableGUIExample : MonoBehaviour
{
    [ShowInInspector]
    public int GUIDisabledProperty { get { return 20; } }

    [ShowInInspector, EnableGUI]
    public int GUIEnabledProperty { get { return 10; } }
}


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

链接:https://www.jianshu.com/p/7760fa8d69d0

上一篇 下一篇

猜你喜欢

热点阅读