public void ResumeGame() //To leverage this funciton the pause screen gameobject must implement the pause script! { Time.timeScale = 1; menuDelegateAction = gameObject.GetComponent <PauseMenu>().GameMaster.GetComponent <GameStateManager>().UnPauseGame; gameObject.GetComponent <PauseMenu>().GameMaster.GetComponent <GameStateManager>().isPaused = false; ExecuteAfterTime(milliSecondDelay, menuDelegateAction); }
//Delays void action to allow menu sound to play before execution async void ExecuteAfterTime(int milliSeconds, MenuDelegateAction e) { await Task.Delay(milliSeconds); e.Invoke(); }
public void QuitGame() //Will after build quit the game { menuDelegateAction = Application.Quit; ExecuteAfterTime(milliSecondDelay, menuDelegateAction); }