public void Restart() { PlayerPrefs.SetInt("currentCard", -1); PlayerPrefs.SetString("usedCards", ""); PlayerPrefs.SetInt("ans", 0); Jauges.restart(); Start(); }
public void end(GameObject panel, string txt) { PlayerPrefs.SetInt("currentCard", -1); PlayerPrefs.SetString("usedCards", ""); //PlayerPrefs.SetInt("annees", 0); Jauges.restart(); game.SetActive(false); //messageLose.text = txt; panel.SetActive(true); running = false; }
public void Start() { clickTxt.gameObject.SetActive(false); img.gameObject.SetActive(true); deltaT = Time.fixedDeltaTime; //PlayerPrefs.SetInt("dimension", 0); //PlayerPrefs.SetInt("anneesPassees", 0); mainPanel.SetActive(true); menu.SetActive(false); chargement.SetActive(false); dimensionTxt.gameObject.SetActive(false); placePlanete(PlayerPrefs.GetInt("xPlanete"), PlayerPrefs.GetInt("yPlanete")); anneesPassees = PlayerPrefs.GetInt("anneesPassees"); dimension = PlayerPrefs.GetInt("dimension"); anneesPasseesTxt.text = "An " + anneesPassees.ToString(); dimensionTxt.text = "Dimension C " + dimension.ToString(); ans = PlayerPrefs.GetInt("ans"); //Debug.Log(PlayerPrefs.GetInt("lose")); if (PlayerPrefs.GetInt("lose") == 1) { PlayerPrefs.SetInt("currentCard", -1); PlayerPrefs.SetString("usedCards", ""); PlayerPrefs.SetInt("ans", 0); Jauges.restart(); dimension += 1; ansTxt.text = " + " + ans.ToString(); StartCoroutine(sortieDimentionAnimation(Random.Range(-30, 50) * 100, Random.Range(-30, 50) * 100)); //Debug.Log("changeDim"); PlayerPrefs.SetInt("lose", 0); } else { //Debug.Log("restaureDim"); StartCoroutine(entreeDimentionAimation(PlayerPrefs.GetInt("xPlanete"), PlayerPrefs.GetInt("yPlanete"))); } }