Esempio n. 1
0
 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");
 }
Esempio n. 2
0
    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;
            }
        }
    }
Esempio n. 3
0
 public static void ClearMemory()
 {
     GameTool.DeleteAll();
     Debug.Log("成功清空数据");
 }