void Start() { isEnoughMoney = true; messageInterval = 1.5f; destroyPowerup = PlayerPrefs.GetInt("destroyPowerup"); heartPowerup = PlayerPrefs.GetInt("heartPowerup"); timerPowerup = PlayerPrefs.GetInt("timerPowerup"); coin = PlayerPrefs.GetInt("Coins"); if (destroyPowerup == null) { destroyPowerup = 0; PlayerPrefs.SetInt("destroyPowerup", destroyPowerup); } if (heartPowerup == null) { heartPowerup = 0; PlayerPrefs.SetInt("heartPowerup", heartPowerup); } if (timerPowerup == null) { timerPowerup = 0; PlayerPrefs.SetInt("timerPowerup", timerPowerup); } GameObject coinSystem = GameObject.FindGameObjectWithTag("MainCamera"); c = (CoinSystemScript)coinSystem.GetComponent("CoinSystemScript"); coin = c.GetCoin(); }
void Start(){ isEnoughMoney = true; messageInterval = 1.5f; destroyPowerup = PlayerPrefs.GetInt("destroyPowerup"); heartPowerup = PlayerPrefs.GetInt("heartPowerup"); timerPowerup = PlayerPrefs.GetInt("timerPowerup"); coin = PlayerPrefs.GetInt("Coins"); if (destroyPowerup == null) { destroyPowerup = 0; PlayerPrefs.SetInt("destroyPowerup", destroyPowerup); } if (heartPowerup == null) { heartPowerup = 0; PlayerPrefs.SetInt("heartPowerup", heartPowerup); } if (timerPowerup == null) { timerPowerup = 0; PlayerPrefs.SetInt("timerPowerup", timerPowerup); } GameObject coinSystem = GameObject.FindGameObjectWithTag("MainCamera"); c = (CoinSystemScript)coinSystem.GetComponent("CoinSystemScript"); coin = c.GetCoin (); }
void Update() { coin = c.GetCoin(); }