From 70f1fe8c5b9131ad867775be0a5faa94ac5fa532 Mon Sep 17 00:00:00 2001 From: vis2k Date: Wed, 16 Jan 2019 12:08:37 +0100 Subject: [PATCH] NetworkIdentity: move update methods next to each other --- Assets/Mirror/Runtime/NetworkIdentity.cs | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index bef4ff5a6..5bfd1cda1 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -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() {