public void LooseOk() { btn = GameObject.FindGameObjectWithTag("btne").GetComponent <Button>(); if (btn.interactable = true) { PlayerPrefs.SetInt("panel", 0); soundManager.PlayButtonSound(); int energy = PlayerPrefs.GetInt("totalEnergy"); energy -= 1; PlayerPrefs.SetInt("FirstE", 1); PlayerPrefs.SetInt("totalEnergy", energy); int e = PlayerPrefs.GetInt("totalEnergy"); Debug.Log("Elose" + e); tryMenu.SetActive(false); PlayerPrefs.SetInt("panel", 0); //int totalEnergy = PlayerPrefs.GetInt("totalEnergy"); //Debug.Log("E1" + totalEnergy); //totalEnergy--; //PlayerPrefs.SetInt("firstEnergy", 1); //PlayerPrefs.SetInt("totalEnergy", totalEnergy); int lvl = PlayerPrefs.GetInt("OnLevel"); Debug.Log("onlevel" + lvl); board.LoseEnergy(); endgame.SetupGame(); goal.SetGoal(); //endgame.SetupGame(); //confirmPAnel.GetComponent<ConfirmPanel>().level = lvl; //levelButton.LoseConfirmPanel(lvl); //confirmPAnel.Play(); //confirmPanel.GetComponent<ConfirmPanel>().level = lvl; //world.; levels[lvl]; //manager.UseEnergyMethod(); //tryMenu.SetActive(false); //int loseCoin = PlayerPrefs.GetInt("Coin"); //loseCoin -= 900; //PlayerPrefs.SetInt("Coin", loseCoin); //board.LoseManager(); //endgame.SetupGame(); } }