Fixed deserialization of decimal script fields

This commit is contained in:
Simon Lübeß
2026-10-21 15:58:53 +02:00
parent ba8b5ed47b
commit 25cbf58106
2 changed files with 6 additions and 2 deletions
@@ -176,6 +176,8 @@ public class SerializedObject
public void SerializeField(string fieldName, object? fieldValue, Type fieldType)
{
// Decimals are not actually primitives, but we treat them as if they were, because they are a built-in type
// and it makes more sense to send them over to the engine as a binary type than to serialize their underlying fields (which would happen when we treated them as a struct).
if (fieldType.IsPrimitive || fieldType == typeof(decimal))
{
// Primitives can't be null