From fc7d2e8df656abff7ef02b9a5c522a3b31a24a24 Mon Sep 17 00:00:00 2001 From: vis2k Date: Fri, 28 Feb 2020 16:31:39 +0100 Subject: [PATCH] NetworkIdentity: OnStartLocalPlayer moved next to OnStartClient --- Assets/Mirror/Runtime/NetworkIdentity.cs | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index 00559fd04..ef91fee24 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -570,6 +570,19 @@ internal void OnStartClient() } } + private static NetworkIdentity previousLocalPlayer = null; + internal void OnStartLocalPlayer() + { + if (previousLocalPlayer == this) + return; + previousLocalPlayer = this; + + foreach (NetworkBehaviour comp in NetworkBehaviours) + { + comp.OnStartLocalPlayer(); + } + } + bool hadAuthority; internal void NotifyAuthority() { @@ -885,19 +898,6 @@ internal void HandleRPC(int componentIndex, int rpcHash, NetworkReader reader) HandleRemoteCall(componentIndex, rpcHash, MirrorInvokeType.ClientRpc, reader); } - private static NetworkIdentity previousLocalPlayer = null; - internal void OnStartLocalPlayer() - { - if (previousLocalPlayer == this) - return; - previousLocalPlayer = this; - - foreach (NetworkBehaviour comp in NetworkBehaviours) - { - comp.OnStartLocalPlayer(); - } - } - internal void OnNetworkDestroy() { foreach (NetworkBehaviour comp in NetworkBehaviours)