コード例 #1
0
ファイル: LocalClient.cs プロジェクト: bejita968/Mirror
 // 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);
 }
コード例 #2
0
ファイル: LocalClient.cs プロジェクト: kelvinRosa/Mirror
        // 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);
        }