public void ClickUnlock() { Debug.Log("解锁"); XPlayerPrefs.SetInt(levelID.ToString() + isUnlock, -1); XPlayerPrefs.Save(); Destroy(transform.Find("unlockBtn").gameObject); }
private static void PassAllStage_Func(object[] objs) { Debug.Log("pass"); //string numAllStar = "numAllStar"; string isUnlock = "isUnlock"; string isCompleted = "isCompleted"; //string numStar = "numStar"; LevelConfig_ARRAY m_config = LevelMgr.GetInstance().GetLevelConfigArray(); for (int i = 0; i < m_config.Items.Count; i++) { string id = m_config.Items[i].LevelId.ToString(); //设置关卡解锁状态 XPlayerPrefs.SetInt(id + isUnlock, -1); XPlayerPrefs.SetInt(id + isCompleted, 1); ////设置当前关卡星星 //int preStar = XPlayerPrefs.GetInt(id + numStar); //XPlayerPrefs.SetInt(id + numStar, 3); ////设置总星星数量 //int curNum = XPlayerPrefs.GetInt(numAllStar); //XPlayerPrefs.SetInt(numAllStar, curNum + 3 - preStar); } //保存 XPlayerPrefs.Save(); }
public void OnShow() { if (gameObject.name == "UIEnd(Clone)") { LoadOriginImg(); SetToNextLevel(); //保存 XPlayerPrefs.Save(); } }
public void ClickEnterLevel() { if (XPlayerPrefs.GetInt(levelID.ToString() + isUnlock) == -1) { Debug.Log("enter"); if (buttonCheck) { buttonCheck = false; setState(); gameObject.transform.GetComponentInParent <UILevelList>().EnterLevel(); XPlayerPrefs.SetInt(curLevel, (int)levelID); XPlayerPrefs.Save(); } } else { Debug.Log("未解锁"); } }
public void ClickSettingSave() { XPlayerPrefs.Save(); setting.SetActive(false); }
private static void ClearAcount_Func(object[] objs) { Debug.Log("clear"); XPlayerPrefs.DeleteAll(); XPlayerPrefs.Save(); }
private void OnApplicationQuit() { XPlayerPrefs.Save(); Debuger.DeInit(); }