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

36 lines
869 B
C#
Raw Normal View History

2024-04-11 01:55:35 -07:00
using GadGame.Manager;
2024-04-15 04:10:00 -07:00
using GadGame.Network;
using UnityEngine;
2024-04-11 01:55:35 -07:00
2024-04-15 04:10:00 -07:00
namespace GadGame.State.MainFlowState
2024-04-11 01:55:35 -07:00
{
public class CTAState : State<MainFlow>
{
2024-04-15 04:10:00 -07:00
private float _noPassByTimer;
2024-04-11 01:55:35 -07:00
public override void Enter()
{
LoadSceneManager.Instance.LoadSceneWithTransition(Runner.SceneFlowConfig.CTAScene.ScenePath);
}
2024-04-15 04:10:00 -07:00
public override void Update(float time)
2024-04-11 01:55:35 -07:00
{
2024-04-15 04:10:00 -07:00
if (!DataReceiver.Instance.DataReceived.PassBy)
{
_noPassByTimer += Time.deltaTime;
if (_noPassByTimer >= 10)
{
Runner.SetState<IdleState>();
}
}
else
2024-04-11 01:55:35 -07:00
{
2024-04-15 04:10:00 -07:00
_noPassByTimer = 0;
}
2024-04-11 01:55:35 -07:00
}
public override void Exit()
{
2024-04-15 04:10:00 -07:00
_noPassByTimer = 0;
2024-04-11 01:55:35 -07:00
}
}
}