Fork me on GitHub

unity_实用小技巧(const)

const:声明某个常量字段或常量局部变量。

注意:常量字段和常量局部变量不是变量并且不能修改

利用const管理游戏标签

例如:

 //管理所有标签
    public const string PlayerPrefs= "player";
    public const string enemys = "enemys";
    public const string items = "items";

posted @ 2017-10-29 11:48  爱上游戏开发  阅读(2379)  评论(0编辑  收藏  举报
 >>>转载请注明出处