閱讀75 返回首頁    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判斷字符串長度