初涉UnityEditor
程序员文章站
2022-04-22 14:53:50
...
ContextMenu
[ContextMenu("Do something")]
private void DoSomething()
{
print("test do something");
}
ContextMenuItem
[ContextMenuItem("Reset", "ResetName")]
public string name = "Eagle";
private void ResetName()
{
name = "Default";
}
ExecuteInEditMode
public Transform target;
void Update()
{
if (target)
transform.LookAt(target);
}
Header
[Header("Value")]
public int currentValue = 0;
public int maxValue = 100;
[Header("Count")]
public int currentCount = 10;
public int maxCount = 100;
MultilineAttribute and Range
[MultilineAttribute]
public string mText;
[Range(0, 100)]
public int Value;
更多内容请参考:http://www.unity.5helpyou.com/3550.html
http://www.manew.com/home.php?mod=space&uid=75030&do=thread&view=me&from=space