示例#1
0
 /// <summary>
 /// Converts NetworkUser to NetworkConnection
 /// </summary>
 /// <param name="user"></param>
 /// <returns>NetworkUser's NetworkConnection</returns>
 private static UnityEngine.Networking.NetworkConnection ResolveUserToConnection(NetworkUser user)
 {
     foreach (NetworkConnection networkConnection in NetworkServer.connections)
     {
         if (networkConnection != null)
         {
             foreach (NetworkUser networkUser in GetConnectionNetworkUsers(networkConnection))
             {
                 // i don't know, but i think there can be more than 1 networkUser
                 if (user.Equals(networkUser))
                 {
                     return(networkConnection);
                 }
             }
         }
     }
     return(null);
 }