码迷,mamicode.com
首页 > 编程语言 > 详细

unity_实用小技巧(const)

时间:2017-10-29 12:49:56      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:利用   游戏   layer   span   变量   ref   unit   items   实用   

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

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

利用const管理游戏标签

例如:

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

unity_实用小技巧(const)

标签:利用   游戏   layer   span   变量   ref   unit   items   实用   

原文地址:http://www.cnblogs.com/shirln/p/7749686.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!