55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using FSM;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
namespace DongWuYiXue.QiGuanChaGuan
|
|
{
|
|
public class BaoLuHuiYanState : FsmState<FSMManager>
|
|
{
|
|
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(6, 0);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
fsm.AddScore(6, 0);
|
|
}
|
|
fsm.PlayClip("暴露会厌_TimeLine", () =>
|
|
{
|
|
fsm.nextState = true;
|
|
});
|
|
}
|
|
}
|
|
public override void OnStateExit()
|
|
{
|
|
base.OnStateExit();
|
|
isChaRu = false;
|
|
if (null != cor)
|
|
{
|
|
Game.Instance.IEnumeratorManager.Stop(cor);
|
|
cor = null;
|
|
}
|
|
fsm.nextState = false;
|
|
}
|
|
}
|
|
}
|