smart-interactive-display/Assets/GadGame/Scripts/State/MainFlowState/IdleState.cs

37 lines
881 B
C#
Raw Normal View History

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-06-19 02:32:17 -07:00
Runner.PlayPassByAnim.Raise(false);
Runner.PlayVideo.Raise(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-22 02:10:49 -07:00
Runner.SetState<PassByState>();
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>();
return;
2024-04-11 01:55:35 -07:00
}
}
public override void Exit()
{
2024-06-19 02:32:17 -07:00
Runner.PlayVideo.Raise(false);
2024-04-11 01:55:35 -07:00
}
}
}