2025-11-24 17:31:57 +08:00

74 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using FSM;
using UnityEngine;
using ZXKFramework;
namespace DongWuYiXue.QiGuanChaGuan
{
public class ChaRuQiGuanDaoGuanState : FsmState<FSMManager>
{
bool isChaRu;
float chaRuValue;
Coroutine cor;
public override void OnStateEnter()
{
base.OnStateEnter();
this.Log("˝řČë˛ĺČëĆřšÜľźšÜ×´ĚŹ");
isChaRu = false;
chaRuValue = 0;
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)
{
//if (Input.GetKeyDown(KeyCode.L))
//{
// chaRuValue = 1;
//}
if (GameManager.Instance.senSor.GetSensor<QiGuanChaGuan_Sensor>().qiGuanDeep > 60)
{
chaRuValue = 1;
}
fsm.PlayClip("˛ĺČëĆřšÜľźšÜ_TimeLine", null, chaRuValue);
if (chaRuValue >= 1.0f)
{
isChaRu = false;
chaRuValue = 0;
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{
fsm.AddScore(6, 0);
fsm.ShowTxtQuestion("˛ĺšÜ˛Ů×÷Ąˇ˛ĺČëĆřšÜľźšÜĄˇ˛˝Öč2", 3, 1, 3, () =>
{
fsm.nextState = true;
});
}
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(8, 0);
fsm.nextState = true;
}
}
}
}
public override void OnStateExit()
{
base.OnStateExit();
isChaRu = false;
chaRuValue = 0;
if (null != cor)
{
Game.Instance.IEnumeratorManager.Stop(cor);
cor = null;
}
fsm.nextState = false;
}
}
}