const:声明某个常量字段或常量局部变量。
注意:常量字段和常量局部变量不是变量并且不能修改
利用const管理游戏标签
例如:
//管理所有标签
public const string PlayerPrefs= "player";
public const string enemys = "enemys";
public const string items = "items";
const变量是不能更改其值的变量。静态变量是可以从类本身获得的,而不是任何对象(这些都是用于大多数目的的全局变量)。const值没有内存管理开销,因为它不需要收集。静态变量本身对实例变量的内存管理性能没有好处