mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
more sorting
This commit is contained in:
parent
e4729c2608
commit
330036f1a9
@ -596,26 +596,6 @@ public static bool AddPlayerForConnection(NetworkConnection conn, GameObject pla
|
||||
return AddPlayerForConnection(conn, player);
|
||||
}
|
||||
|
||||
/// <summary>Replaces connection's player object. The old object is not destroyed.</summary>
|
||||
// This does NOT change the ready state of the connection, so it can
|
||||
// safely be used while changing scenes.
|
||||
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority = false)
|
||||
{
|
||||
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
|
||||
}
|
||||
|
||||
/// <summary>Replaces connection's player object. The old object is not destroyed.</summary>
|
||||
// This does NOT change the ready state of the connection, so it can
|
||||
// safely be used while changing scenes.
|
||||
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, Guid assetId, bool keepAuthority = false)
|
||||
{
|
||||
if (GetNetworkIdentity(player, out NetworkIdentity identity))
|
||||
{
|
||||
identity.assetId = assetId;
|
||||
}
|
||||
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
|
||||
}
|
||||
|
||||
internal static bool InternalReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority)
|
||||
{
|
||||
NetworkIdentity identity = player.GetComponent<NetworkIdentity>();
|
||||
@ -665,6 +645,26 @@ internal static bool InternalReplacePlayerForConnection(NetworkConnection conn,
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>Replaces connection's player object. The old object is not destroyed.</summary>
|
||||
// This does NOT change the ready state of the connection, so it can
|
||||
// safely be used while changing scenes.
|
||||
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority = false)
|
||||
{
|
||||
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
|
||||
}
|
||||
|
||||
/// <summary>Replaces connection's player object. The old object is not destroyed.</summary>
|
||||
// This does NOT change the ready state of the connection, so it can
|
||||
// safely be used while changing scenes.
|
||||
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, Guid assetId, bool keepAuthority = false)
|
||||
{
|
||||
if (GetNetworkIdentity(player, out NetworkIdentity identity))
|
||||
{
|
||||
identity.assetId = assetId;
|
||||
}
|
||||
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
|
||||
}
|
||||
|
||||
// ready ///////////////////////////////////////////////////////////////
|
||||
/// <summary>Flags client connection as ready (=joined world).</summary>
|
||||
// When a client has signaled that it is ready, this method tells the
|
||||
|
Loading…
Reference in New Issue
Block a user