阅读75 返回首页    go 阿里云 go 技术社区[云栖]


unity 脚本中的一些attribute

1.Serializable

The Serializable attribute lets you embed a class with sub properties in the inspector.

让你能够把它嵌入到另外一个class时在属性编辑器里能将其展开

 

[System.Serializable]

class Test{

public int p = 5;

public Color c = Color.white;

}

 

public class Test2:MonoBehaviour{

     public Test[] t;

}

 

这样在编辑器里Test里的t是能进一步展开的,这个很有用

 

最后更新:2017-04-03 12:54:31

  上一篇:go Linux C 下的大文件操作
  下一篇:go Java判断字符串长度