GetCoin() public method

public GetCoin ( ) : int
return int
Beispiel #1
0
    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();
    }
Beispiel #2
0
	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 ();
	}
Beispiel #3
0
 void Update()
 {
     coin = c.GetCoin();
 }