コード例 #1
0
 private void Die()
 {
     if (_musicManager != null)
     {
         _lastVolume = _musicManager.GetVolume();
         _currVolume = _musicManager.GetDefaultVolume() / 10;
     }
     _darkener.color = new Color(r: _darkener.color.r, g: _darkener.color.g, b: _darkener.color.b, 0.5f);
     maxSpeed        = 0.2f;
     _isDead         = true;
     GetComponent <SpriteRenderer>().enabled = false;
     _pm.SetCreating(false);
     _deathManager.SetActive();
     _deathManager.coinText.text = "Coins:\n<sprite=0> " + Coin.coinAmount;
     PlayerPrefs.SetInt("Money", PlayerPrefs.GetInt("Money") + Coin.coinAmount);
     Coin.coinAmount = 0;
     ManageGooglePlayStats();
     GC.Collect();
 }