NetworkIdentity: OnStartLocalPlayer moved next to OnStartClient

This commit is contained in:
vis2k 2020-02-28 16:31:39 +01:00
parent 1c356bff44
commit fc7d2e8df6

View File

@ -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)