コード例 #1
0
 //Spawn player on death if there are lives left.
 private void Spawn()
 {
     if (PlayerStatsManager.GetPlayerLives() > 0f)
     {
         Vector2 startPos = new Vector2(-5.3f, 0f);
         transform.position = startPos;
         PlayerStatsManager.SetPlayerHealth(maxHealth);
         PlayerStatsManager.SetUpgradePoints(-10f);
     }
     else
     {
         PlayerStatsManager.SetCanSpawn(false);
         SceneManager.LoadScene("game_over");
         Destroy(gameObject);
     }
 }
コード例 #2
0
 //increase upgrade points in player manager.
 public void PassUpgradeValue()
 {
     PlayerStatsManager.SetUpgradePoints(coinUpgradeValue);
 }