66 lines
1.9 KiB
C#
66 lines
1.9 KiB
C#
using FSM;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
namespace DongWuYiXue.QiGuanChaGuan
|
|
{
|
|
public class ChaRuQiGuanDaoGuanState : 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(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;
|
|
}
|
|
}
|
|
}
|