public void InitData() { GameTool.DeleteAll();//测试用 if (!GameTool.HasKey("CoinCount")) { GameTool.SetInt("CoinCount", 100); } coinCount = GameTool.GetInt("CoinCount"); if (!GameTool.HasKey("RedCount")) { GameTool.SetInt("RedCount", 20); } redCount = GameTool.GetInt("RedCount"); }
protected override void OnEnable() { GameTool.DeleteAll();//测试用 if (content.childCount == 0) { return; } int current = LevelManager.Instance.GetCurrentMaxLevel(); Debug.Log("当前开启的最高关卡时" + current); for (int i = 1; i < content.childCount + 1; i++) { if (i <= current) { GameObject levelItem = content.GetChild(i - 1).gameObject; GameTool.GetTheChildComponent <Button>(levelItem, "Btn_Level").enabled = true; GameTool.GetTheChildComponent <Image>(levelItem, "Btn_Level").color = Color.white; } } }
public static void ClearMemory() { GameTool.DeleteAll(); Debug.Log("成功清空数据"); }