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
+11 -1
View File
@@ -67,7 +67,17 @@ namespace GlitchyEngine
{
for (var value in dictionary)
delete value.key;
delete dictionary;
dictionary.Clear();
}
}
public static mixin ClearDictionaryAndDeleteValues(var dictionary)
{
if (dictionary != null)
{
for (var value in dictionary)
delete value.value;
dictionary.Clear();
}
}