// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2020-12-01 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections; using System.Collections.Generic; using UnityEngine; namespace G { public enum GameMode { None, Normal, Boss = 2, Adventure = 3, Limit = 4, /// /// 护送 /// Escort = 5, Infinity, } /// /// 模式 /// partial class GameLevel { #region Field private float _stageTime = 0f; private float _stageProgress = 0f; #endregion #region Property /// /// 关卡模式 /// public GameMode stageMode { get; private set; } public float stageTime { get => _stageTime; } public float stageProgress { get => _stageProgress; set => _stageProgress = value; } #endregion #region Method /// /// /// /// public void SetMode(int mode) { stageMode = (GameMode)mode; if (stageMode == GameMode.Limit) { _stageTime = curStageItem.typeArgs[0]; GameCamera.Instance.SetMode(mode); } else { _stageTime = 0f; } } public void MissionSuccess() { FinishStage(true); EntityManager.Instance.RemoveAllEntity(); } public void MissionFail() { Debug.Log("游戏结束 任务失败"); FinishStage(false); EntityManager.Instance.RemoveAllEntity(); } private void UpdateMode() { if (_stageFinish || _spawnStartTime < 0f) return; //限时模型 if (stageMode == GameMode.Limit) { if (_stageTime > 0) { _stageTime -= Time.deltaTime; if (_stageTime <= 0f) { MissionFail(); } } } else { _stageTime += Time.deltaTime; } } #endregion } }