Example #1
0
    public void AddCoins()
    {
        int x = Random.Range(1, 6);

        this.CoinCount = x;
        PrefsManager.AddToTotalCoins(x);
        PrefsManager.AddToCurrentCoins(x);
        CoinPerk       = x;
        this.count    += x;
        this.text.text = this.count.ToString();

        InvokeRepeating("spawnCoin", 0.1f, 0.1f);

        //for (int i = 0; i < x; i++)
        //{
        //    Invoke("spawnCoin",0.01f);
        //}
    }