UniVRM/Scripts/BlendShape/Editor/MaterialValueBindingPropertyDrawer.cs
2018-04-06 22:31:12 +09:00

32 lines
1000 B
C#

using UnityEditor;
using UnityEngine;
namespace VRM
{
[CustomPropertyDrawer(typeof(MaterialValueBinding))]
public class MaterialValueBindingPropertyDrawer : PropertyDrawer
{
public static int GUIElementHeight = 90;
public override void OnGUI(Rect position,
SerializedProperty property, GUIContent label)
{
using (new EditorGUI.PropertyScope(position, label, property))
{
var y = position.y;
for (var depth = property.depth;
property.NextVisible(true) && property.depth > depth;
)
{
{
var height = EditorGUI.GetPropertyHeight(property);
EditorGUI.PropertyField(new Rect(position.x, y, position.width, height), property, false);
y += height;
}
}
}
}
}
}