using System; using System.Collections; using System.Collections.Generic; using AX.Network.Protocols; using UnityEngine; using AX.Serialization; using AX.InputSystem; using UnityEngine.AI; using AX.MessageSystem; public class TRAPPED_GUIDANCE_SYNC : NetworkMessageBehaviour { private TrappedMoveFree trapped; void Start() { trapped = GetComponent(); } protected override void Execute(BinaryMessage message) { InputHistory.Instance.RegisterInputHistory(message); var info = message.Body.Deserialize(); // var sender = info.SendUserID; if (InputManager.Instance) { if (CurrentUserInfo.mySelf.Id != info.SendUserID) { if (info.gameObjID == GetComponent().gameObjID) { if (info.IsSetPoint == true) { if (trapped.MeetDangerous) { trapped.MeetDangerous = false; } trapped.CancelInvokeRandom(); trapped.Guidance = true; trapped.IsSetPoint = true; trapped.IsselfClient = false; GetComponent().StopAllCoroutines(); GetComponent().SetDestination(transform.position); trapped.targetPosition = transform.position; trapped.movestate = MoveState.IDLE; } else { if (info.IsEnd == false) { trapped.SaveFrirmanUserId = info.SaveFiremanUserID; trapped.Guidance = true; trapped.IsSetPoint = false; trapped.guidPoint = info.Guidlist; trapped.IsselfClient = false; TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs(); arg.hitPoint = info.Guidlist[0]; GetComponent().targetPosition = arg.hitPoint; //arg.gameObjID = GetComponent().gameObjID; arg.gameObjIdSelf = GetComponent().gameObjID; TrappedPathFindingCommand.Instance.Execute(GetComponent().gameObjID, arg); } else { trapped.Guidance = false; trapped.movestate = MoveState.IDLE; GetComponent().StopAllCoroutines(); //GetComponent().enabled = false; trapped.OverMoveOrGuidance = true; //MessageDispatcher.SendMessage("SomeoneOutOfTrap"); //通知火场信息-疏散救生-被困时间部分更新,看是否可以停止计时 TrappedTime.CheckStopTime(); // GetComponent().SetFloat("Speed", 0); } } } } } } }