mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
removing cahced field (#1641)
This commit is contained in:
parent
4d5cee893d
commit
456fde07bc
@ -1233,10 +1233,6 @@ internal void Reset()
|
||||
ClearObservers();
|
||||
}
|
||||
|
||||
// MirrorUpdate is a hot path. Caching the vars msg is really worth it to
|
||||
// avoid large amounts of allocations.
|
||||
static UpdateVarsMessage varsMessage = new UpdateVarsMessage();
|
||||
|
||||
// invoked by NetworkServer during Update()
|
||||
internal void ServerUpdate()
|
||||
{
|
||||
@ -1249,8 +1245,10 @@ internal void ServerUpdate()
|
||||
OnSerializeAllSafely(false, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten);
|
||||
if (ownerWritten > 0 || observersWritten > 0)
|
||||
{
|
||||
// populate cached UpdateVarsMessage and send
|
||||
varsMessage.netId = netId;
|
||||
UpdateVarsMessage varsMessage = new UpdateVarsMessage
|
||||
{
|
||||
netId = netId
|
||||
};
|
||||
|
||||
// send ownerWriter to owner
|
||||
// (only if we serialized anything for owner)
|
||||
|
Loading…
Reference in New Issue
Block a user