2025-09-09 15:06:44 +08:00
|
|
|
|
using FSM;
|
2025-09-11 17:23:47 +08:00
|
|
|
|
using Unity.VisualScripting.FullSerializer;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using ZXKFramework;
|
2025-09-09 15:06:44 +08:00
|
|
|
|
namespace DongWuYiXue.DaoNiaoShu
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ChaGuanState : FsmState<FSMManager>
|
|
|
|
|
|
{
|
2025-09-11 17:23:47 +08:00
|
|
|
|
bool isChaGuan = false;
|
|
|
|
|
|
float chaGuanValue = 0;
|
2025-09-09 15:06:44 +08:00
|
|
|
|
public override void OnStateEnter()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnStateEnter();
|
2025-09-11 17:23:47 +08:00
|
|
|
|
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();
|
2025-09-11 17:23:47 +08:00
|
|
|
|
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();
|
2025-09-11 17:23:47 +08:00
|
|
|
|
isChaGuan = false;
|
|
|
|
|
|
fsm.nextState = false;
|
2025-09-09 15:06:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|