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; } }
}