using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using XFramework.NetOuter; /// /// 状态+事件同步物体发送基类 /// public abstract class StateSyncSenderBase : MonoBehaviour,IStateSyncSend { protected string soleName; protected virtual void Awake() { this.soleName = this.gameObject.name; } public void ExitSendList() { SyncGOManager.Instance.RemoveSender(this); } public abstract Type GetMsgType(); public string GetSoleName() { return soleName; } public abstract object GetSyncMsg(); public void JoinSendList() { SyncGOManager.Instance.AddSender(this); } //发送同步行为 protected void SendSyncAction( NetActionType netActionType) { IProtoBuilder protoBuilder = new ActionProtoBuilder(GroupLearnHelper.ThisIP, soleName, netActionType); NetUDPManager.Instance.SendNetMess(protoBuilder.GetProto()); } }