美文网首页
Odin Inspector 系列教程 --- Enable G

Odin Inspector 系列教程 --- Enable G

作者: 忆中异 | 来源:发表于2021-11-24 15:36 被阅读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

相关文章

网友评论

      本文标题:Odin Inspector 系列教程 --- Enable G

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