using FSM; using UnityEngine; using ZXKFramework; namespace YiLiao.XinFeiTingZhen { public class DouXingXinDongGuoSuState : FsmState { bool step; string PositionValue { get { return GameManager.Instance.sensorManager.GetSensor().positionValue.ToString(); } } public override void OnStateEnter() { base.OnStateEnter(); GameManager.Instance.sensorManager.SendFunction("#ID:5;SONG:3;%"); fsm.ShowTip(0); fsm.PlayBgm(0); fsm.PlayClip("窦性心动过速"); fsm.Light_EnableInteraction("group22"); step = true; //fsm.InteractionDown("group22", obj => { // fsm.StopBgm(); // fsm.Unlight_DisableInteraction("group22"); // fsm.InteractionDown("group22", null); // Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true }); // fsm.PlayClip("窦性心动过速2"); // ChatUI.Instance.SendAI("心脏听诊》病理性心音》窦性心动过速》步骤1",null); // fsm.ShowNextPanel(() => { // ChatUI.Instance.CloseChatTxt(); // fsm.StopClip("窦性心动过速2"); // fsm.ShowTxtQuestion("心脏听诊》病理性心音》窦性心动过速》步骤2", 2, 0, 0, () => // { // fsm.nextState = true; // }); // }); //}); } public override void OnStateStay() { base.OnStateStay(); if (PositionValue == "5" || Input.GetKeyDown(KeyCode.L)) { if (step) { step = false; fsm.StopBgm(); fsm.Unlight_DisableInteraction("group22"); //fsm.InteractionDown("group22", null); Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true }); fsm.PlayClip("窦性心动过速_听诊器"); ChatUI.Instance.SendAI("心脏听诊》病理性心音》窦性心动过速》步骤1", null); fsm.ShowNextPanel(() => { fsm.StopClip("窦性心动过速_听诊器"); ChatUI.Instance.CloseChatTxt(); fsm.ShowTxtQuestion("心脏听诊》病理性心音》窦性心动过速》步骤2", 2, 0, 0, () => { fsm.nextState = true; }); }); } } } public override void OnStateExit() { base.OnStateExit(); step = false; fsm.StopClip("窦性心动过速_听诊器"); fsm.nextState = false; } } }