void Update() { if (!paused) { if (Input.GetButtonDown("Cancel") || Input.GetKeyDown(KeyCode.I) || Input.GetKeyDown(KeyCode.F)) { if (Input.GetButtonDown("Cancel")) { menuState = MenuManager.MenuState.System; } if (Input.GetKeyDown(KeyCode.I)) { menuState = MenuManager.MenuState.Items; } if (Input.GetKeyDown(KeyCode.F)) { menuState = MenuManager.MenuState.Flow; } Pause(menuState, false); } } else if (Input.GetButtonDown("Cancel") || Input.GetKeyDown(KeyCode.I) || Input.GetKeyDown(KeyCode.F)) { Resume(); } }
public void Pause(MenuManager.MenuState state, bool exploreMode) { //GetComponent<CanvasGroup>().alpha = 0; conversation.SetActive(false); explore.SetActive(false); if (!exploreMode) { lastMode = PlayMode.gameMode; } else { lastMode = PlayMode.GameMode.Explore; } PlayMode.ChangeGameMode(PlayMode.GameMode.Menu); menuCanvas.SetActive(true); menuCanvas.GetComponent <MenuManager>().SetMenu(state); paused = true; }