void Start()
        {
            _msgDistri.AddOnceListenner(NamesOfProtocol.ReceivePlayerData, OnReceivePlayerDataBack);
            _msgDistri.AddListener(NamesOfProtocol.Kickoff, OnKickoffBack);

            _playerMgr.Init();
            StartCoroutine(ReceivePlayerData());
        }
Пример #2
0
 public bool Send(ProtocolBase protocol, Action <ProtocolBase> protoMethod, [Optional] string name)
 {
     if (status != NetworkStatus.Connected)
     {
         return(false);
     }
     if (name == null)
     {
         name = protocol.Name;
     }
     _msgDistri.AddListener(name, protoMethod);
     return(Send(proto));
 }
Пример #3
0
 private void Awake()
 {
     _msgDistri.AddListener(NamesOfProtocol.Login, OnLoginBack);
 }
Пример #4
0
 private void Start()
 {
     _msgDis.AddOnceListenner(NamesOfProtocol.SendOriginPos, OnSendOriginPosBack);
     _msgDis.AddListener(NamesOfProtocol.UpdatePosition, UpdateLocationBack);
     _msgDis.AddOnceListenner(NamesOfProtocol.SendPlayerData, OnSendPlayerDataBack);
 }