mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
per NI WIP
This commit is contained in:
parent
69d9aa2ff0
commit
4bebec8173
@ -3,6 +3,7 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using Mirror.RemoteCalls;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Profiling;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@ -936,6 +937,8 @@ internal static bool IsDirty(ulong mask, int index)
|
||||
// check ownerWritten/observersWritten to know if anything was written
|
||||
internal void SerializeServer(bool initialState, NetworkWriter ownerWriter, NetworkWriter observersWriter)
|
||||
{
|
||||
// profiling marker for shallow profiling to show more than "UpdateFunction.Invoke
|
||||
Profiler.BeginSample($"NetworkIdentity({name}): SerializeServer"); // TODO nonalloc
|
||||
// ensure NetworkBehaviours are valid before usage
|
||||
ValidateComponents();
|
||||
NetworkBehaviour[] components = NetworkBehaviours;
|
||||
@ -1004,11 +1007,16 @@ internal void SerializeServer(bool initialState, NetworkWriter ownerWriter, Netw
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Profiler.EndSample();
|
||||
}
|
||||
|
||||
// serialize components into writer on the client.
|
||||
internal void SerializeClient(NetworkWriter writer)
|
||||
{
|
||||
// profiling marker for shallow profiling to show more than "UpdateFunction.Invoke
|
||||
Profiler.BeginSample($"NetworkIdentity({name}): SerializeClient"); // TODO nonalloc
|
||||
|
||||
// ensure NetworkBehaviours are valid before usage
|
||||
ValidateComponents();
|
||||
NetworkBehaviour[] components = NetworkBehaviours;
|
||||
@ -1061,6 +1069,8 @@ internal void SerializeClient(NetworkWriter writer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Profiler.EndSample();
|
||||
}
|
||||
|
||||
// deserialize components from the client on the server.
|
||||
|
Loading…
Reference in New Issue
Block a user