public void EnterNormalMode() { UIManager.instance.CloseAllWindows(); UIManager.instance.ShowSceneEnteringWindow(() => { this.gameMode = Common.GameMode.NORMAL; LoadUserScene(); }); SoundManager.instance.StopAllSounds(); SoundManager.instance.PlaySound(SoundManager.instance.BGM, true); }
public void OnModeChange(int index) { currentStep = (Common.GameMode)index; if (currentStep != Common.GameMode.step_1) { for (int i = 1; i <= pice_1_Arr.Length; i++) { pice_1_Arr[i - 1].gameObject.SetActive(false); pice_2_Arr[i - 1].gameObject.SetActive(false); } } }
public void EnterAttackMode() { UIManager.instance.CloseAllWindows(); UIManager.instance.ShowSceneEnteringWindow(() => { this.gameMode = Common.GameMode.ATTACK; this.LoadEnemyScene(); AttackOverlayWindowScript.instance.SwordManCounter.text = this._swordManCount.ToString() + "x"; AttackOverlayWindowScript.instance.ArcherCounter.text = this._archerCount.ToString() + "x"; }); SoundManager.instance.StopAllSounds(); }
void Update() { if (!hasLocalPlayer) { return; } //返回前厅 if (!_running) { StartCoroutine(ReturnToLoby()); } else { if ((team_2_Num >= Common.Step_1_Sum || team_1_Num >= Common.Step_1_Sum) && currentStep == (Common.GameMode) 1) { currentStep = (Common.GameMode) 2; DestroyAllSprite(); ui_main.OnModeChange(2); countDown = Common.timeList[2]; /*用于测试的数据: */ team_1_Num = 6; team_2_Num = 6; } if (currentStep == (Common.GameMode) 2) { if (countDown > 0) { countDown -= Time.deltaTime; ui_main.SetTime(countDown); if (team_1_Num <= 0 || team_2_Num <= 0) { _running = false; } else { team_1_Num -= Time.deltaTime * Common.decTime_1; team_2_Num -= Time.deltaTime * Common.decTime_1; } ui_main.OnAddEnegy(1, team_1_Num); ui_main.OnAddEnegy(2, team_2_Num); } else { } } } }