/// <summary> /// 计时器时间到 /// </summary> /// <param name="timer">时间到的计时器</param> public virtual void Event_TimerRing(Timer timer) { if (CurrentStagePart != null) { CurrentStagePart.Event_TimerRing(timer); } }
/// <summary> /// 使关卡尝试触发事件 /// </summary> public virtual void Touch() { if (CurrentStagePart != null) { CurrentStagePart.Touch(); } }
/// <summary> /// 玩家死亡后触发的事件 /// </summary> /// <param name="player"></param> public virtual void Event_PlayerDied(Unit player) { if (CurrentStagePart != null) { CurrentStagePart.Event_PlayerDied(player); } if (failWhenPlayerDied) { Fail("玩家已经死亡"); } }
/// <summary> /// 单位死亡后触发的事件 /// </summary> /// <param name="deadUnit">死去的单位</param> public virtual void Event_UnitDied(Unit deadUnit) { if (CurrentStagePart != null) { CurrentStagePart.Event_UnitDied(deadUnit); if (deadUnit == Player) { Event_PlayerDied(deadUnit); } } }
/// <summary> /// 读取关卡片段(用于游戏中切换) /// </summary> /// <param name="stagePart"></param> public void LoadStagePart(int part) { SwitchStagePart(part); PartChanged(part, currentStagePartIndex); CurrentStagePart.Initialize(); }
/// <summary> /// 读取关卡片段(从该片段开始游戏) /// </summary> /// <param name="stagePart"></param> public virtual void StartFromStagePart(int part) { SwitchStagePart(part); CurrentStagePart.StartFormThis(); CurrentStagePart.Initialize(); }