Пример #1
0
        public void OnPhotonInstantiate(PhotonMessageInfo info)
        {
            object[] instantiationData = info.photonView.InstantiationData;

            NetworkArgs args = null;

            if (instantiationData?.Length > 0)
            {
                args = instantiationData[0] as NetworkArgs;
            }

            object[] remotePlayerArgs = new object[]
            {
                photonView,
                args,
            };

            if (photonView.IsMine)
            {
                _networkSystem.CreateRemotePlayerLocalPlayer(this, remotePlayerArgs);
            }
            else
            {
                _networkSystem.CreatedRemotePlayer(this, remotePlayerArgs);
            }

            _networkSystem.ReceivedRemotePlayerCustomData(this, args);
        }
Пример #2
0
 private void Inject(IMultiplayerNetworkSystem networkSystem)
 {
     if (photonView.IsMine)
     {
         networkSystem.CreateRemotePlayerLocalPlayer(this, photonView);
     }
     else
     {
         networkSystem.CreatedRemotePlayer(this, photonView);
     }
 }