75 lines
2.7 KiB
C#
75 lines
2.7 KiB
C#
using FSM;
|
||
using UnityEngine;
|
||
using ZXKFramework;
|
||
namespace YiLiao.XinFeiTingZhen
|
||
{
|
||
public class GanLuoYinState : 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("SM_huxi");
|
||
step = true;
|
||
GameManager.Instance.sensorManager.SendFunction("#ID:6;SONG:28;%");
|
||
//fsm.InteractionDown("SM_huxi", obj => {
|
||
// fsm.StopBgm();
|
||
// fsm.Unlight_DisableInteraction("SM_huxi");
|
||
// fsm.InteractionDown("SM_huxi", 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", 12, 0, 0, () => {
|
||
// fsm.nextState = true;
|
||
// });
|
||
// });
|
||
//});
|
||
}
|
||
|
||
public override void OnStateStay()
|
||
{
|
||
base.OnStateStay();
|
||
if (PositionValue == "6" || Input.GetKeyDown(KeyCode.L))
|
||
{
|
||
if (step)
|
||
{
|
||
step = false;
|
||
fsm.StopBgm();
|
||
fsm.Unlight_DisableInteraction("SM_huxi");
|
||
//fsm.InteractionDown("SM_huxi", null);
|
||
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
||
fsm.PlayClip("¸É†ªÒô_ÌýÕïÆ÷");
|
||
ChatUI.Instance.SendAI("·Î²¿ÌýÕï¡·ÐØ²¿Õý³£ÌýÕïÒô¡·¸É†ªÒô¡·²½Öè1", null);
|
||
fsm.ShowNextPanel(() => {
|
||
ChatUI.Instance.CloseChatTxt();
|
||
fsm.StopClip("¸É†ªÒô_ÌýÕïÆ÷");
|
||
fsm.ShowTxtQuestion("·Î²¿ÌýÕï¡·ÐØ²¿Õý³£ÌýÕïÒô¡·¸É†ªÒô¡·²½Öè2", 12, 0, 0, () => {
|
||
fsm.nextState = true;
|
||
});
|
||
});
|
||
}
|
||
}
|
||
}
|
||
public override void OnStateExit()
|
||
{
|
||
base.OnStateExit();
|
||
step = false;
|
||
fsm.StopClip("¸É†ªÒô_ÌýÕïÆ÷");
|
||
fsm.nextState = true;
|
||
}
|
||
}
|
||
}
|