Skip to content

Commit

Permalink
fix(UIManager): when on last level dont load any other
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasctnh committed May 1, 2022
1 parent 87732b9 commit 9c7727a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Assets/Scripts/UI/UIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ public void CloseAnyMenu() {
#region State-Changing Methods

public void Continue() {
if (SceneManager.GetActiveScene().buildIndex + 1 >= SceneManager.sceneCountInBuildSettings)
bool isLastLevel = SceneManager.GetActiveScene().buildIndex + 1 >= SceneManager.sceneCountInBuildSettings;
if (isLastLevel) {
GameManager.Instance.LoadLevel(0);
return;
}

GameManager.Instance.LoadLevel(SceneManager.GetActiveScene().buildIndex + 1);
}
Expand Down

0 comments on commit 9c7727a

Please sign in to comment.