using GadGame.Manager; using GadGame.Network; using UnityEngine; namespace GadGame.State.MainFlowState { public class CTAState : State { private float _noPassByTimer; public override void Enter() { LoadSceneManager.Instance.LoadSceneWithTransition(Runner.SceneFlowConfig.CTAScene.ScenePath); } public override void Update(float time) { if (!UdpSocket.Instance.DataReceived.PassBy) { _noPassByTimer += Time.deltaTime; if (_noPassByTimer >= 5) { if(!UdpSocket.Instance.DataReceived.PassBy) { Runner.SetState(); return; } if(!UdpSocket.Instance.DataReceived.OnVision) { Runner.SetState(); return; } if(!UdpSocket.Instance.DataReceived.Engage) { Runner.SetState(); return; } Runner.SetState(); } } else { _noPassByTimer = 0; } } public override void Exit() { _noPassByTimer = 0; } } }