Start of Script Instance deserialization

- Also deserialize when stopping the game to restore pre play state
- Fixed ancient bug where ClearDictionaryAndDeleteKeys falsly deletes the dictionary
- Added ClearDictionaryAndDeleteValues helper mixin
This commit is contained in:
Simon Lübeß
2023-12-24 01:30:01 +01:00
parent c9116812b4
commit d0f0a34247
7 changed files with 579 additions and 204 deletions
+14
View File
@@ -559,6 +559,20 @@ static class ScriptGlue
newContext = Internal.UnsafeCastToPtr(newObject);
newId = newObject.Id;
}
[RegisterCall("ScriptGlue::Serialization_DeserializeField")]
public static void Serialization_DeserializeField(void* internalContext, SerializationType expectedType, MonoString* fieldName, uint8* target)
{
SerializedObject context = Internal.UnsafeCastToObject(internalContext) as SerializedObject;
Log.EngineLogger.AssertDebug(context != null);
char8* name = Mono.mono_string_to_utf8(fieldName);
context.GetField(StringView(name), expectedType, target);
Mono.mono_free(name);
}
#endregion