using System; using System.Collections; using System.Collections.Generic; using AX.Network.Protocols; using UnityEngine; using AX.Serialization; public class WATERCURTAIN_HIDEORSHOW_SYNC : NetworkMessageBehaviour { protected override void OnDisable() {//完全从写为空,以便隐藏时不会注销此事件,隐藏再通过此事件显示才会有响应 } protected override void Execute(BinaryMessage message) { InputHistory.Instance.RegisterInputHistory(message); var info = message.Body.Deserialize(); if (InputManager.Instance) { //if (info.GameObjId == GetComponent().gameObjID) //{ // gameObject.SetActive(info.isShow); //} //避免水幕水带出水情况下删除后(水幕特效在实体管理器还存在), //再有水幕水带出水后关闭出水时,原来已删除水幕水带还存在于实体管理器的水幕特效接收到此同步时,上面注释掉的代码报丢失引用 EntitiesManager.Instance.GetEntityByID(info.GameObjId).SetActive(info.isShow); } } }