Exemplo n.º 1
0
 //Should launch at the beginning of every scene
 public void ReloadScene()
 {
     if (GameObject.FindGameObjectWithTag("Player") != null)
     {
         Player      = GameObject.FindGameObjectWithTag("Player");
         PlayerStats = Player.GetComponent <PlayerStatManager>();
         if (NewGame)
         {
             PlayerStats.SetBase();
             _saveData.SaveStats(PlayerStats);
             NewGame = false;
         }
         else
         {
             _saveData.LoadStats(ref PlayerStats);
         }
     }
 }
Exemplo n.º 2
0
 private void Awake()
 {
     _stats = GetComponent <PlayerStatManager>();
     _rb    = GetComponent <Rigidbody>();
     _stats.SetBase();
 }