Game Over menu is added.

posted in: Weekly Progress | 0

On Death of the player game over menu is shown.

On game over menu there are three buttons

one is play again from the start of the game

2nd is for continuing the game where the player was killed.

3rd is to go back to main menu.

 

Here is the code :

 

 

using UnityEngine;
using System.Collections;

public class GameOverMenuController : MonoBehaviour
{
public float Score;

public void PlayAgainButton()
{
// restart level
InventoryManager.Instance.UpdatePlayerInventory();
ProfileManager.Instance.SaveSettingsOfProfile();

LevelManager.Instance.RestartLevel();
EventSystemController.Instance.DeselectGameObjects();
}

public void MainMenuButton()
{
// main menu
InventoryManager.Instance.UpdatePlayerInventory();
ProfileManager.Instance.SaveSettingsOfProfile();

LevelManager.Instance.ResetLevel();
GameManager.Instance.OpenStartupScene();
EventSystemController.Instance.DeselectGameObjects();
}
}

Leave a Reply