69 lines
2.4 KiB
C#
69 lines
2.4 KiB
C#
using FSM;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
namespace YiLiao.XinFeiTingZhen
|
|
{
|
|
public class BenMaLvState : FsmState<FSMManager>
|
|
{
|
|
bool step;
|
|
string PositionValue
|
|
{
|
|
get
|
|
{
|
|
return GameManager.Instance.sensorManager.GetSensor<TZQ_Sensor>().positionValue.ToString();
|
|
}
|
|
}
|
|
public override void OnStateEnter()
|
|
{
|
|
base.OnStateEnter();
|
|
fsm.ShowTip(0);
|
|
fsm.PlayBgm(0);
|
|
fsm.PlayClip("奔马律");
|
|
fsm.Light_EnableInteraction("group22");
|
|
step = true;
|
|
GameManager.Instance.sensorManager.SendFunction("#ID:5;SONG:10;%");
|
|
//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("心脏听诊》病理性心音》奔马律", null);
|
|
// fsm.ShowNextPanel(() => {
|
|
// ChatUI.Instance.CloseChatTxt();
|
|
// fsm.StopClip("奔马律2");
|
|
// 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("心脏听诊》病理性心音》奔马律", null);
|
|
fsm.ShowNextPanel(() => {
|
|
ChatUI.Instance.CloseChatTxt();
|
|
fsm.nextState = true;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
public override void OnStateExit()
|
|
{
|
|
base.OnStateExit();
|
|
step = false;
|
|
fsm.StopClip("奔马律_听诊器");
|
|
fsm.nextState = false;
|
|
}
|
|
}
|
|
}
|