mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
This reverts commit 6eec19b205
.
This commit is contained in:
parent
7dc918b706
commit
40a3ecce08
@ -348,12 +348,6 @@ void GenerateSerialization()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_SyncVars.Count == 0)
|
|
||||||
{
|
|
||||||
// nothing to sync, use base OnSerialize
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
MethodDefinition serialize = new MethodDefinition("OnSerialize", MethodAttributes.Public |
|
MethodDefinition serialize = new MethodDefinition("OnSerialize", MethodAttributes.Public |
|
||||||
MethodAttributes.Virtual |
|
MethodAttributes.Virtual |
|
||||||
MethodAttributes.HideBySig,
|
MethodAttributes.HideBySig,
|
||||||
@ -379,6 +373,15 @@ void GenerateSerialization()
|
|||||||
serWorker.Append(serWorker.Create(OpCodes.Stloc_0)); // set dirtyLocal to result of base.OnSerialize()
|
serWorker.Append(serWorker.Create(OpCodes.Stloc_0)); // set dirtyLocal to result of base.OnSerialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_SyncVars.Count == 0)
|
||||||
|
{
|
||||||
|
// generate: return dirtyLocal
|
||||||
|
serWorker.Append(serWorker.Create(OpCodes.Ldloc_0));
|
||||||
|
serWorker.Append(serWorker.Create(OpCodes.Ret));
|
||||||
|
m_td.Methods.Add(serialize);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Generates: if (forceAll);
|
// Generates: if (forceAll);
|
||||||
Instruction initialStateLabel = serWorker.Create(OpCodes.Nop);
|
Instruction initialStateLabel = serWorker.Create(OpCodes.Nop);
|
||||||
serWorker.Append(serWorker.Create(OpCodes.Ldarg_2)); // forceAll
|
serWorker.Append(serWorker.Create(OpCodes.Ldarg_2)); // forceAll
|
||||||
@ -551,12 +554,6 @@ void GenerateDeSerialization()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_SyncVars.Count == 0)
|
|
||||||
{
|
|
||||||
// nothing to sync, base OnDeserialize is fine
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
MethodDefinition serialize = new MethodDefinition("OnDeserialize", MethodAttributes.Public |
|
MethodDefinition serialize = new MethodDefinition("OnDeserialize", MethodAttributes.Public |
|
||||||
MethodAttributes.Virtual |
|
MethodAttributes.Virtual |
|
||||||
MethodAttributes.HideBySig,
|
MethodAttributes.HideBySig,
|
||||||
@ -575,6 +572,13 @@ void GenerateDeSerialization()
|
|||||||
serWorker.Append(serWorker.Create(OpCodes.Call, baseDeserialize));
|
serWorker.Append(serWorker.Create(OpCodes.Call, baseDeserialize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_SyncVars.Count == 0)
|
||||||
|
{
|
||||||
|
serWorker.Append(serWorker.Create(OpCodes.Ret));
|
||||||
|
m_td.Methods.Add(serialize);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Generates: if (initialState);
|
// Generates: if (initialState);
|
||||||
Instruction initialStateLabel = serWorker.Create(OpCodes.Nop);
|
Instruction initialStateLabel = serWorker.Create(OpCodes.Nop);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user