2024-06-18 23:34:19 -07:00
|
|
|
using Cysharp.Threading.Tasks;
|
2024-04-11 01:55:35 -07:00
|
|
|
using GadGame.Network;
|
|
|
|
|
2024-04-15 04:10:00 -07:00
|
|
|
namespace GadGame.State.MainFlowState
|
2024-04-11 01:55:35 -07:00
|
|
|
{
|
|
|
|
public class IdleState : State<MainFlow>
|
|
|
|
{
|
2024-06-18 23:34:19 -07:00
|
|
|
public override async void Enter()
|
2024-04-11 01:55:35 -07:00
|
|
|
{
|
2024-06-18 23:34:19 -07:00
|
|
|
await UniTask.Delay(1000);
|
2024-04-25 04:54:33 -07:00
|
|
|
PassByAnimation.Instance.Play(false);
|
|
|
|
PassByAnimation.Instance.SetPlayVideo(true);
|
2024-04-11 01:55:35 -07:00
|
|
|
}
|
|
|
|
|
2024-04-15 04:10:00 -07:00
|
|
|
public override void Update(float time)
|
2024-04-11 01:55:35 -07:00
|
|
|
{
|
2024-04-25 23:57:30 -07:00
|
|
|
if(time < 2) return;
|
2024-04-22 02:10:49 -07:00
|
|
|
|
|
|
|
if (UdpSocket.Instance.DataReceived.PassBy)
|
2024-04-17 20:53:46 -07:00
|
|
|
{
|
2024-04-22 02:10:49 -07:00
|
|
|
Runner.SetState<PassByState>();
|
2024-04-17 20:53:46 -07:00
|
|
|
return;
|
|
|
|
}
|
2024-04-22 02:10:49 -07:00
|
|
|
|
|
|
|
if (UdpSocket.Instance.DataReceived.Engage)
|
2024-04-11 01:55:35 -07:00
|
|
|
{
|
2024-04-22 02:10:49 -07:00
|
|
|
Runner.SetState<EngageState>();
|
2024-04-17 20:53:46 -07:00
|
|
|
return;
|
2024-04-11 01:55:35 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Exit()
|
|
|
|
{
|
2024-04-25 04:54:33 -07:00
|
|
|
PassByAnimation.Instance.SetPlayVideo(false);
|
2024-04-11 01:55:35 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|