欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

初涉UnityEditor

程序员文章站 2022-04-22 14:53:50
...


ContextMenu


 [ContextMenu("Do something")]
    private void DoSomething()
    {
        print("test do something");
    }

初涉UnityEditor


ContextMenuItem


 [ContextMenuItem("Reset", "ResetName")]
    public string name = "Eagle";
    private void ResetName()
    {
        name = "Default";
    }

初涉UnityEditor



ExecuteInEditMode

 public Transform target;
    void Update()
    {
        if (target)
            transform.LookAt(target);
    }

初涉UnityEditor



Header

    [Header("Value")]
    public int currentValue = 0;
    public int maxValue = 100;

    [Header("Count")]
    public int currentCount = 10;
    public int maxCount = 100;


初涉UnityEditor



MultilineAttribute and Range

   [MultilineAttribute]
    public string mText;

    [Range(0, 100)]
    public int Value;

初涉UnityEditor


更多内容请参考:http://www.unity.5helpyou.com/3550.html

http://www.manew.com/home.php?mod=space&uid=75030&do=thread&view=me&from=space




相关标签: unity editor