2025-09-09 15:06:44 +08:00
|
|
|
|
using FSM;
|
2025-09-13 16:38:19 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using ZXKFramework;
|
2025-09-09 15:06:44 +08:00
|
|
|
|
namespace DongWuYiXue.DaoNiaoShu
|
|
|
|
|
|
{
|
|
|
|
|
|
public class BaChuDaoNiaoGuanState : FsmState<FSMManager>
|
|
|
|
|
|
{
|
2025-09-13 16:38:19 +08:00
|
|
|
|
Coroutine cor;
|
|
|
|
|
|
AVProValue avProValue;
|
|
|
|
|
|
bool isBaGuan = false;
|
|
|
|
|
|
float baGuanValue = 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><CEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬");
|
2025-09-13 16:38:19 +08:00
|
|
|
|
avProValue = GameManager.Instance.transform.FindFirst<AVProValue>("<22>γ<EFBFBD><CEB3><EFBFBD>Ƶ");
|
|
|
|
|
|
baGuanValue = 0;
|
2025-09-12 17:32:44 +08:00
|
|
|
|
fsm.ShowCamera("<22>ι<EFBFBD>_Camera");
|
|
|
|
|
|
fsm.ShowTip(0);
|
|
|
|
|
|
fsm.PlayBgm(0);
|
2025-09-13 16:38:19 +08:00
|
|
|
|
cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
isBaGuan = true;
|
|
|
|
|
|
avProValue.gameObject.SetActive(true);
|
|
|
|
|
|
});
|
2025-09-09 15:06:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
public override void OnStateStay()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnStateStay();
|
2025-11-26 17:26:00 +08:00
|
|
|
|
//if (isBaGuan)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// baGuanValue += .0005f;
|
|
|
|
|
|
// fsm.PlayClip("<22>ι<EFBFBD>_TimeLine", null, baGuanValue);
|
|
|
|
|
|
// avProValue.PlayValue = baGuanValue;
|
|
|
|
|
|
// avProValue.PlayVideoAsValue();
|
|
|
|
|
|
//}
|
|
|
|
|
|
if (isBaGuan && Input.GetKeyDown(KeyCode.L))
|
2025-09-13 16:38:19 +08:00
|
|
|
|
{
|
2025-11-26 17:26:00 +08:00
|
|
|
|
baGuanValue = 1.0f;
|
2025-09-13 16:38:19 +08:00
|
|
|
|
fsm.PlayClip("<22>ι<EFBFBD>_TimeLine", null, baGuanValue);
|
|
|
|
|
|
avProValue.PlayValue = baGuanValue;
|
|
|
|
|
|
avProValue.PlayVideoAsValue();
|
|
|
|
|
|
}
|
2025-11-26 17:26:00 +08:00
|
|
|
|
if (isBaGuan && GameManager.Instance.senSor.GetSensor<DaoNiao_Sensor>().daoNiaoDeep <= 0f)
|
2025-09-13 16:38:19 +08:00
|
|
|
|
{
|
2025-11-26 17:26:00 +08:00
|
|
|
|
//baGuanValue += .0005f;
|
2025-09-13 16:38:19 +08:00
|
|
|
|
baGuanValue = 1.0f;
|
|
|
|
|
|
fsm.PlayClip("<22>ι<EFBFBD>_TimeLine", null, baGuanValue);
|
|
|
|
|
|
avProValue.PlayValue = baGuanValue;
|
|
|
|
|
|
avProValue.PlayVideoAsValue();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (baGuanValue >= 1.0f && isBaGuan)
|
|
|
|
|
|
{
|
|
|
|
|
|
isBaGuan = false;
|
|
|
|
|
|
|
|
|
|
|
|
avProValue.gameObject.SetActive(false);
|
|
|
|
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
|
|
|
|
{
|
|
|
|
|
|
fsm.AddScore(5, 0);
|
|
|
|
|
|
}
|
2025-09-15 19:28:05 +08:00
|
|
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
|
|
|
|
{
|
|
|
|
|
|
fsm.AddScore(3, 0);
|
|
|
|
|
|
}
|
2025-09-13 16:38:19 +08:00
|
|
|
|
fsm.nextState = true;
|
|
|
|
|
|
}
|
2025-09-09 15:06:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
public override void OnStateExit()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnStateExit();
|
2025-09-13 16:38:19 +08:00
|
|
|
|
if (null != cor)
|
|
|
|
|
|
{
|
|
|
|
|
|
Game.Instance.IEnumeratorManager.Stop(cor);
|
|
|
|
|
|
cor = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
isBaGuan = false;
|
|
|
|
|
|
avProValue.gameObject.SetActive(false);
|
|
|
|
|
|
fsm.nextState = false;
|
2025-09-09 15:06:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|