Esempio n. 1
0
 // Called by the server to set the LocalClient's LocalPlayer object during NetworkServer.AddPlayer()
 internal void AddLocalPlayer(NetworkIdentity localPlayer)
 {
     if (LogFilter.Debug)
     {
         Debug.Log("Local client AddLocalPlayer " + localPlayer.gameObject.name + " conn=" + connection.connectionId);
     }
     connection.isReady = true;
     connection.SetPlayerController(localPlayer);
     if (localPlayer != null)
     {
         localPlayer.isClient = true;
         NetworkIdentity.spawned[localPlayer.netId] = localPlayer;
         localPlayer.connectionToServer             = connection;
     }
     // there is no SystemOwnerMessage for local client. add to ClientScene here instead
     ClientScene.InternalAddPlayer(localPlayer);
 }
Esempio n. 2
0
        // Called by the server to set the LocalClient's LocalPlayer object during NetworkServer.AddPlayer()
        internal void AddLocalPlayer(NetworkIdentity localPlayer)
        {
            if (LogFilter.logDev)
            {
                Debug.Log("Local client AddLocalPlayer " + localPlayer.gameObject.name + " conn=" + m_Connection.connectionId);
            }
            m_Connection.isReady = true;
            m_Connection.SetPlayerController(localPlayer);
            NetworkIdentity uv = localPlayer;

            if (uv != null)
            {
                ClientScene.SetLocalObject(uv.netId, localPlayer.gameObject);
                uv.SetConnectionToServer(m_Connection);
            }
            // there is no SystemOwnerMessage for local client. add to ClientScene here instead
            ClientScene.InternalAddPlayer(uv);
        }