public void LoadScene() { checkPointPos = SaveLoadCheckpoint.LoadLevelCheckPointData(); int SceneNum; string SceneName; //Level 2.something cases if (checkPointPos[3] > 2 && checkPointPos[3] < 3) { SceneName = "Level_" + checkPointPos[3].ToString(); Debug.Log("Scenename = \"" + SceneName + "\""); } else if (checkPointPos[3] >= 10) { SceneName = "Boss Fight 0" + checkPointPos[3].ToString().Remove(1, 1); Debug.Log("Boss Fight = \"" + SceneName + "\""); } else { SceneNum = (int)checkPointPos[3]; SceneName = "Level_" + SceneNum + ".0"; } Scene Dest = SceneManager.GetSceneByName(SceneName); SceneSwitch = true; SceneManager.LoadScene(SceneName); }
public void ContinueResume() { Debug.Log("Resuming game"); pauseMenuUI.SetActive(false); Time.timeScale = 1f; GameIsPaused = false; float[] checkPointPos = new float[5]; checkPointPos = SaveLoadCheckpoint.LoadLevelCheckPointData(); PlayerHealthManager.SetHP((int)SaveLoadCheckpoint.LoadLevelCheckPointData()[4]); }
void Awake() { checkPointPos = new float[5]; if (SceneSwitch) { GameObject Player = GameObject.FindGameObjectWithTag("Player"); checkPointPos = SaveLoadCheckpoint.LoadLevelCheckPointData(); Player.transform.position = new Vector3(checkPointPos[0], checkPointPos[1] + 3, checkPointPos[2]); SceneSwitch = false; UpdateHealth = true; Debug.Log("UpdateHealth is " + UpdateHealth); } }
public void Resume() { Debug.Log("Resuming game"); pauseMenuUI.SetActive(false); Time.timeScale = 1f; GameIsPaused = false; if (Checkpoint.UpdateHealth) { PlayerHealthManager.SetHP((int)SaveLoadCheckpoint.LoadLevelCheckPointData()[4]); Debug.Log("Continue Button Exception: Start with " + (int)SaveLoadCheckpoint.LoadLevelCheckPointData()[4] + " lives"); //Change Update Health back to false Checkpoint.ChangeUpdateHealth(); Debug.Log("Continue Button Exception: UpdateHealth is " + Checkpoint.UpdateHealth); } }
public void Load() { checkPointPos = SaveLoadCheckpoint.LoadLevelCheckPointData(); }