using FSM; using UnityEngine; using ZXKFramework; namespace DongWuYiXue.QiGuanChaGuan { public class ChaRuQiGuanDaoGuanState : FsmState { bool isChaRu; Coroutine cor; public override void OnStateEnter() { base.OnStateEnter(); this.Log("进入插入气管导管状态"); fsm.ShowCamera("插入气管导管_Camera"); fsm.ShowTip(1); fsm.PlayBgm(1); cor = Game.Instance.IEnumeratorManager.Run(3.0f, () => { isChaRu = true; }); } public override void OnStateStay() { base.OnStateStay(); if (isChaRu) { isChaRu = false; if (fsm.main_gameModel.modeType == ModeType.ShiXun) { fsm.AddScore(8, 0); } if (fsm.main_gameModel.modeType == ModeType.KaoHe) { fsm.AddScore(6, 0); } fsm.PlayClip("插入气管导管_TimeLine", () => { if (fsm.main_gameModel.modeType == ModeType.KaoHe) { fsm.ShowTxtQuestion(3, 3, 1, () => { fsm.nextState = true; }); } if (fsm.main_gameModel.modeType == ModeType.ShiXun) { fsm.nextState = true; } }); } } public override void OnStateExit() { base.OnStateExit(); isChaRu = false; if (null != cor) { Game.Instance.IEnumeratorManager.Stop(cor); cor = null; } fsm.nextState = false; } } }