public void GameOver(bool forced) { int g = GameOverCheck(); if (g != -1 || forced) { isOver = true; if (g == 1) { Debug.Log("You Win"); } else { Debug.Log("You Lost"); } this.gameObject.SetActive(false); MidGameUI.SetActive(false); StartGameUI.SetActive(true); PauseGameUI.SetActive(false); camera.StartIt(); camera.GameStart(); isPaused = false; } }
private void ShowPauseGameUI() { GameModel gameModel = GetModel <GameModel>(); PauseGameUI pauseGameUI = GetView <PauseGameUI>(); pauseGameUI.Distance = gameModel.Distance; pauseGameUI.Coin = gameModel.Coin; pauseGameUI.Goal = gameModel.Goal; pauseGameUI.Show(); }
private void PauseGameUI(PauseGameUI pause) { if (pause.enabled) { pauseCanvas.enabled = true; } else { pauseCanvas.enabled = false; } }
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { PauseButton(); } if (!isOver) { if (!isPaused) { Arrow.Target = currentTurn.GiveCulprit.Object; if (currentTurn.culprit.TeamNumber == 1) { isPlayer = true; } else { isPlayer = false; } if (!isPlayer) { if (!currentTurn.isFinished) { aI.Update(); } } else { if (!isWaiting()) { currentTurn.targetAquired = true; currentTurn.Update(); } } DeleteCharacters(); GameOver(false); Range(); } else { PauseGameUI.SetActive(true); } } /* Debug.Log($"Turn isMoving: {currentTurn.isMoving}"); * Debug.Log($"Turn isAttacking: {currentTurn.isAttacking}"); * Debug.Log($"Turn usedSkill: {currentTurn.usedSkill}"); */ }
public void PauseButton() { if (isPaused) { PauseGameUI.SetActive(false); MidGameUI.SetActive(true); } else { MidGameUI.SetActive(false); } isPaused = !isPaused; }
void Awake() { Debug.Log("Setting PauseGameUI singleton"); //Setup singleton if (singleton == null) { singleton = this; } else { Destroy(gameObject); return; } onResume = null; }
public override void Execute(object data) { GameSetting.Instance.playSound.PlayBgAudio(Const.Bgm_ZhanDou); GameModel gameModel = GetModel <GameModel>(); PauseGameUI pauseGameUI = GetView <PauseGameUI>(); ContinueGameUI continueGameUI = GetView <ContinueGameUI>(); if ((bool)data) { gameModel.IsPause = false; GameSetting.Instance.playSound.PlayStepAudio(); } else { pauseGameUI.Hide(); continueGameUI.Show("continue"); } }
public static ListPanelUI Create(IEnumerable <ListUIOption> options, string title, string description, string button, int gold, PauseGameUI parent, bool closeOnComplete = false, bool closeUIOnComplete = false) { var instance = Instantiate(UIManager.ListPanelUI); instance.title.text = title; instance.description.text = description; //this.button.text = button; instance.gold.text = $"Gold: {gold}"; foreach (var option in options) { var clone = Instantiate(instance.prefab, instance.content); if (closeOnComplete || closeUIOnComplete) { var action = new Action(option.Action); if (closeUIOnComplete) { action += () => parent.CloseUI(); } if (closeOnComplete) { action += () => instance.CloseUI(); } clone.Initialize(option.Description, action.Invoke, option.IsEnabled); } else { clone.Initialize(option.Description, option.Action, option.IsEnabled); } instance.currentOptions.Add(option.Description, clone); } return(instance); }