NetworkIdentity: move update methods next to each other

This commit is contained in:
vis2k 2019-01-16 12:08:37 +01:00
parent f32ac7dfe6
commit 70f1fe8c5b

View File

@ -629,25 +629,6 @@ internal void HandleRPC(int componentIndex, int rpcHash, NetworkReader reader)
HandleRemoteCall(componentIndex, rpcHash, UNetInvokeType.ClientRpc, reader);
}
// invoked by unity runtime immediately after the regular "Update()" function.
internal void UNetUpdate()
{
if (observers.Count == 0)
return;
// serialize all the dirty components and send (if any were dirty)
byte[] payload = OnSerializeAllSafely(false);
if (payload != null)
{
// construct message and send
UpdateVarsMessage message = new UpdateVarsMessage();
message.netId = netId;
message.payload = payload;
NetworkServer.SendToReady(gameObject, (short)MsgType.UpdateVars, message);
}
}
internal void OnUpdateVars(NetworkReader reader, bool initialState)
{
if (initialState && m_NetworkBehaviours == null)
@ -946,6 +927,25 @@ internal void Reset()
m_ClientAuthorityOwner = null;
}
// invoked by unity runtime immediately after the regular "Update()" function.
internal void UNetUpdate()
{
if (observers.Count == 0)
return;
// serialize all the dirty components and send (if any were dirty)
byte[] payload = OnSerializeAllSafely(false);
if (payload != null)
{
// construct message and send
UpdateVarsMessage message = new UpdateVarsMessage();
message.netId = netId;
message.payload = payload;
NetworkServer.SendToReady(gameObject, (short)MsgType.UpdateVars, message);
}
}
// this is invoked by the UnityEngine
public static void UNetStaticUpdate()
{