mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-11 13:04:17 -05:00
32 lines
1001 B
C#
32 lines
1001 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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|