Exemplo n.º 1
0
        public void DroppingCoinOnDeath()
        {
            PlayerStats     playerStats     = FindObjectOfType <PlayerStats>();
            CurrencyCounter currencyCounter = FindObjectOfType <CurrencyCounter>();

            if (playerStats != null)
            {
                playerStats.AddCoins(enemyStats.coinsDrop);
                if (currencyCounter != null)
                {
                    currencyCounter.SetCoinText(playerStats.coinCount);
                }
            }
        }
Exemplo n.º 2
0
        // Start is called before the first frame update
        void Start()
        {
            CheckSaveFile();
            //CheckSavedProfile();
            if (PlayerPrefs.HasKey("_coins"))
            {
                PlayerStats     playerStats     = FindObjectOfType <PlayerStats>();
                CurrencyCounter currencyCounter = FindObjectOfType <CurrencyCounter>();

                if (playerStats != null)
                {
                    playerStats.coinCount = PlayerPrefs.GetInt("_coins");
                    if (currencyCounter != null)
                    {
                        currencyCounter.SetCoinText(playerStats.coinCount);
                    }
                }
            }
        }