Add assets

This commit is contained in:
2025-05-08 16:03:30 +09:00
parent cd4ebdb0a7
commit 57b037e0a9
977 changed files with 91747 additions and 28 deletions

View File

@@ -0,0 +1,32 @@
using UnityEditor;
namespace Cainos.LucidEditor
{
public static class SerializedPropertyUtility
{
public static System.Type GetUnderlyingType(this SerializedProperty property)
{
System.Type parentType = property.serializedObject.targetObject.GetType();
System.Reflection.FieldInfo fi = parentType.GetFieldViaPath(property.propertyPath);
return fi.FieldType;
}
public static System.Reflection.FieldInfo GetFieldViaPath(this System.Type type, string path)
{
System.Type parentType = type;
System.Reflection.FieldInfo fi = type.GetField(path);
string[] perDot = path.Split('.');
foreach (string fieldName in perDot)
{
fi = parentType.GetField(fieldName);
if (fi != null)
parentType = fi.FieldType;
else
return null;
}
if (fi != null)
return fi;
else return null;
}
}
}