void OnTriggerEnter(Collider cld) { var hero = cld.gameObject.GetComponent <Hero> (); if (hero == null) { return; } Debug.Log("Granting MagnetImpact power to the Hero!" + (CurrentGameSaveData.Data.HasAcquiredMagnetImpact ? " (was already acquired)" : "")); StartCoroutine(ShowExplanations()); CurrentGameSaveData.Data.HasAcquiredMagnetImpact = true; CurrentGameSaveData.Save(); }
// NOTE: Loads the game // If "isNew" it loads a new game, else it loads last game saved public void LoadGame(bool isNew) { gameStarted = true; ResumeGame(); if (isNew) { CurrentGameSaveData.NewGame(); } else { CurrentGameSaveData.LoadGame(); } GameState.Resume(); }
void OnTriggerEnter(Collider cld) { var hero = cld.gameObject.GetComponent <Hero> (); if (hero == null) { return; } var prevID = CurrentGameSaveData.Data.LastCheckpoint; Debug.Log( "The last Checkpoint is now \"" + gameObject.name + "\" (ID:" + ID + " )." + " The previous one was \"" + All[prevID].gameObject.name + "\" (ID: " + prevID + ")." ); CurrentGameSaveData.Data.LastCheckpoint = ID; CurrentGameSaveData.Save(); }