Files
AR-Menu/Library/PackageCache/com.needle.engine-exporter@8c046140a1d9/Meta/Editor/SerializedPropertyUtil.cs
2025-11-30 08:35:03 +02:00

29 lines
724 B
C#

using System;
using Newtonsoft.Json;
using UnityEditor;
namespace Needle.Engine
{
internal static class SerializedPropertyUtil
{
public static void WriteSerializedProperty(this JsonTextWriter writer, SerializedProperty property)
{
writer.WritePropertyName(property.name);
switch (property.propertyType)
{
case SerializedPropertyType.Integer:
writer.WriteValue(property.intValue);
break;
case SerializedPropertyType.Boolean:
writer.WriteValue(property.boolValue);
break;
case SerializedPropertyType.Float:
writer.WriteValue(property.floatValue);
break;
case SerializedPropertyType.String:
writer.WriteValue(property.stringValue);
break;
}
}
}
}