feat: replay flow
parent
5f9e8f0b66
commit
b33bf2148c
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
|
||||||
namespace GadGame.Network
|
namespace GadGame.Network
|
||||||
{
|
{
|
||||||
public enum Genders
|
public enum Genders
|
||||||
|
@ -11,7 +13,7 @@ namespace GadGame.Network
|
||||||
public struct ReceiverData
|
public struct ReceiverData
|
||||||
{
|
{
|
||||||
public bool PassBy;
|
public bool PassBy;
|
||||||
public bool Viewed;
|
public bool OnVision;
|
||||||
public bool Engage;
|
public bool Engage;
|
||||||
public bool Ready;
|
public bool Ready;
|
||||||
public Genders Gender;
|
public Genders Gender;
|
||||||
|
|
|
@ -16,6 +16,16 @@ namespace GadGame.State
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
|
if (!Receiver.Instance.DataReceived.PassBy)
|
||||||
|
{
|
||||||
|
Runner.SetState(typeof(IdleState));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!Receiver.Instance.DataReceived.Engage)
|
||||||
|
{
|
||||||
|
Runner.SetState(typeof(ViewedState));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!Receiver.Instance.DataReceived.Ready) _timer = 0;
|
if (!Receiver.Instance.DataReceived.Ready) _timer = 0;
|
||||||
_timer += Time.deltaTime;
|
_timer += Time.deltaTime;
|
||||||
if (_timer >= 5)
|
if (_timer >= 5)
|
||||||
|
|
|
@ -13,7 +13,12 @@ namespace GadGame.State
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
if (Receiver.Instance.DataReceived.Viewed)
|
if (!Receiver.Instance.DataReceived.PassBy)
|
||||||
|
{
|
||||||
|
Runner.SetState(typeof(IdleState));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Receiver.Instance.DataReceived.OnVision)
|
||||||
{
|
{
|
||||||
Runner.SetState(typeof(ViewedState));
|
Runner.SetState(typeof(ViewedState));
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,11 @@ namespace GadGame.State
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
|
if (!Receiver.Instance.DataReceived.PassBy)
|
||||||
|
{
|
||||||
|
Runner.SetState(typeof(IdleState));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Receiver.Instance.DataReceived.Engage)
|
if (Receiver.Instance.DataReceived.Engage)
|
||||||
{
|
{
|
||||||
Runner.SetState(typeof(EngageState));
|
Runner.SetState(typeof(EngageState));
|
||||||
|
|
Loading…
Reference in New Issue