56 lines
1.5 KiB
C#

using FSM;
using Unity.VisualScripting.FullSerializer;
using UnityEngine;
using ZXKFramework;
namespace DongWuYiXue.DaoNiaoShu
{
public class ChaGuanState : FsmState<FSMManager>
{
bool isChaGuan = false;
float chaGuanValue = 0;
public override void OnStateEnter()
{
base.OnStateEnter();
this.Log("½øÈë²å¹Ü״̬");
isChaGuan = true;
chaGuanValue = 0;
fsm.ShowCamera("²å¹Ü1_Camera");
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.PlayClip("²å¹Ü_TimeLine", () =>
{
});
}
public override void OnStateStay()
{
base.OnStateStay();
if (isChaGuan)
{
chaGuanValue += .0005f;
fsm.PlayClip("²å¹Ü_TimeLine", null, chaGuanValue);
}
if (isChaGuan && Input.GetKeyDown(KeyCode.L))
{
chaGuanValue = 1.0f;
fsm.PlayClip("²å¹Ü_TimeLine", null, chaGuanValue);
}
if (chaGuanValue >= 1.0f)
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(10, 0);
}
isChaGuan = false;
fsm.nextState = true;
}
}
public override void OnStateExit()
{
base.OnStateExit();
isChaGuan = false;
fsm.nextState = false;
}
}
}