可以做初始值,存储本地,用起来真方便呀,真方便!(被值当然,还可以从配置表里面读取)
把这段代码封装在单例里,也是不算的
private string setting_autostate_autouse = "setting_autostate_autouse";
public bool Setting_autostate_autouse{
get { if (!PlayerPrefs.HasKey(setting_autostate_autouse)) Setting_autostate_autouse = true; return PlayerPrefs.GetInt(setting_autostate_autouse) == 1; }
set { PlayerPrefs.SetInt(setting_autostate_autouse, value ? 1 : 0); }
}