unity_实用小技巧(const)


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

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

利用const管理游戏标签

例如:

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM