在U3D显示ReadMe,可以说明脚本用途和用法。
#if UNITY_EDITOR
[Multiline(2)]
public string Readme = "说明脚本用途 \n MultilineAttribute可以设定多行";
[TextArea(2, 5)]
public string TextArea = "的不同之处在于\n" +
"Multiline 不能根据宽度自动换行 \n" +
"TextArea 可以设定默认行数 和 最多行数,\n" +
"一旦显示超过最多行数的话就用scroll表示" +
"\n \n \n 懂了吗?";
#endif
[Header("Game Settings")]
[Range(0, 1)]
public float difficult;
[Range(1, 3)]
public int life;
[Space(16)]
[ColorUsage(false)] //false:只可以调RGB, 开始用到时候可能A=0,可以先用取色器取个颜色再调。
public Color backgroundColor;
[ColorUsage(true)] //true:可以调RGBA
public Color frameColor;