public void DisplayHighScore() { if (sc.GetGameActive() && gops.GetSave().highScore < Mathf.FloorToInt(Altar.GetTimeSinceStart()) && gops.GetMaxHealth() <= 250) { gops.GetSave().highScore = Mathf.FloorToInt(Altar.GetTimeSinceStart()); SaveSystem.SaveGame(gops.GetSave().highScore, gops, ic, mp.GetChosenVolume(), Screen.currentResolution.width, Screen.currentResolution.height, QualitySettings.GetQualityLevel()); } TMPHS.text = "BEST TIME: " + gops.GetSave().highScore + "\n\nPress " + ic.Reset + " to try again."; }
private void SetHealthForPlayer() { if (!hasSetHealth && FindObjectOfType <Player>() && gops && gops.GetSave() != null) { gops.SetMaxHealth(gops.GetSave().defaultMaxHealth); playerunit = FindObjectOfType <Player>().gameObject.GetComponent <Unit>(); playerunit.SetMaxHealth(gops.GetSave().defaultMaxHealth); playerunit.SetHealth(gops.GetSave().defaultMaxHealth); Debug.Log("player health set to " + playerunit.GetHealth()); hasSetHealth = true; } }
public void SaveSettings() { SaveSystem.SaveGame(gops.GetSave().highScore, gops, ic, mp.GetChosenVolume(), Screen.currentResolution.width, Screen.currentResolution.height, QualitySettings.GetQualityLevel()); gops.LoadSaveData(); }