public void Restart() { gameScript = GameObject.Find("GameController").GetComponent <GameControllerTest>(); scoreScript = GameObject.Find("Coins/CoinText").GetComponent <Score>(); scoreScript.AddCoins(gameScript.score); GameObject.Find("Menu").transform.GetComponent <Canvas>().enabled = false; SceneManager.LoadScene(SceneManager.GetActiveScene().name); Time.timeScale = 1; }
public void SellThings() { var tBerries = score.berries; score.berries -= tBerries; score.berriesText.text = score.berries.ToString(); var tBread = score.bread; score.bread -= tBread; score.breadText.text = score.bread.ToString(); int suma = tBerries + tBread; score.AddCoins(suma); }