mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
perf: inline property calls in hot path
This commit is contained in:
parent
7bcaeb6f3a
commit
041953d6fe
@ -118,7 +118,7 @@ public bool authority
|
||||
// component index from in here by searching all NetworkComponents.
|
||||
|
||||
/// <summary>Returns the NetworkIdentity of this object</summary>
|
||||
public NetworkIdentity netIdentity { get; internal set; }
|
||||
public NetworkIdentity netIdentity; // set from NetworkIdentity.InitializeNetworkBehaviours to avoid netIdentity=>flag indirection!
|
||||
|
||||
/// <summary>Returns the index of the component on this object</summary>
|
||||
public byte ComponentIndex { get; internal set; }
|
||||
|
@ -238,12 +238,21 @@ internal set
|
||||
|
||||
/// <summary>Client's network connection to the server. This is only valid for player objects on the client.</summary>
|
||||
// TODO change to NetworkConnectionToServer, but might cause some breaking
|
||||
public NetworkConnection connectionToServer { get; internal set; }
|
||||
public NetworkConnection connectionToServer
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal set;
|
||||
}
|
||||
|
||||
/// <summary>Server's network connection to the client. This is only valid for client-owned objects (including the Player object) on the server.</summary>
|
||||
NetworkConnectionToClient _connectionToClient;
|
||||
public NetworkConnectionToClient connectionToClient
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => _connectionToClient;
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal set
|
||||
{
|
||||
_connectionToClient?.RemoveOwnedObject(this);
|
||||
@ -251,7 +260,6 @@ internal set
|
||||
_connectionToClient?.AddOwnedObject(this);
|
||||
}
|
||||
}
|
||||
NetworkConnectionToClient _connectionToClient;
|
||||
|
||||
// get all NetworkBehaviour components
|
||||
public NetworkBehaviour[] NetworkBehaviours { get; private set; }
|
||||
|
Loading…
Reference in New Issue
Block a user