56 lines
1.5 KiB
C#
Raw Normal View History

2025-09-09 15:06:44 +08:00
using FSM;
using Unity.VisualScripting.FullSerializer;
using UnityEngine;
using ZXKFramework;
2025-09-09 15:06:44 +08:00
namespace DongWuYiXue.DaoNiaoShu
{
public class ChaGuanState : FsmState<FSMManager>
{
bool isChaGuan = false;
float chaGuanValue = 0;
2025-09-09 15:06:44 +08:00
public override void OnStateEnter()
{
base.OnStateEnter();
this.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬");
isChaGuan = true;
chaGuanValue = 0;
fsm.ShowCamera("<22><><EFBFBD><EFBFBD>1_Camera");
fsm.ShowTip(0);
fsm.PlayBgm(0);
fsm.PlayClip("<22><><EFBFBD><EFBFBD>_TimeLine", () =>
{
});
2025-09-09 15:06:44 +08:00
}
public override void OnStateStay()
{
base.OnStateStay();
if (isChaGuan)
{
chaGuanValue += .0005f;
fsm.PlayClip("<22><><EFBFBD><EFBFBD>_TimeLine", null, chaGuanValue);
}
if (isChaGuan && Input.GetKeyDown(KeyCode.L))
{
chaGuanValue = 1.0f;
fsm.PlayClip("<22><><EFBFBD><EFBFBD>_TimeLine", null, chaGuanValue);
}
if (chaGuanValue >= 1.0f)
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(10, 0);
}
isChaGuan = false;
fsm.nextState = true;
}
2025-09-09 15:06:44 +08:00
}
public override void OnStateExit()
{
base.OnStateExit();
isChaGuan = false;
fsm.nextState = false;
2025-09-09 15:06:44 +08:00
}
}
}