UniVRM/Assets/VRM10/Editor/Components/PropGui.cs
ousttrue 3f09717236
Feature10/spring bone editor (#994)
* SceneView switch

* VRM10ControllerEditor を分割

* VRM10/Editor/Components/VRM10ControllerSceneView.cs

* LookAtEditor, SpringBoneEditor

* VRM10SpringBoneColliderGroup and VRM10SpringBone to VRM10ControllerSpringBone. not MonoBehaviour

* ReorderableList

* VRM10Window.cs

* SpringBoneTreeView

* ScrollView

* rename

* VRM10SpringBoneColliderEditor

* SelectedGUIBase

* spring name

* VRM10SpringBoneCollider gizmo to handle

* SelectedGUI

* 再度、VRM10SpringBoneColliderGroup を MonoBehaviour へ。SerializedObject の参照の都合
2021-06-01 16:00:49 +09:00

42 lines
1.1 KiB
C#

using UnityEditor;
namespace UniVRM10
{
/// <summary>
/// 指定した SerializedProperty を起点に再帰的に SerializedProperty を表示する。
/// </summary>
class PropGui
{
SerializedProperty m_root;
public PropGui(SerializedProperty property)
{
m_root = property;
}
// public static PropGui FromSerializedObject(SerializedObject serializedObject, string name)
// {
// var prop = serializedObject.FindProperty(name);
// return new PropGui(prop);
// }
public void RecursiveProperty()
{
var depth = m_root.depth;
var iterator = m_root.Copy();
for (var enterChildren = true; iterator.NextVisible(enterChildren); enterChildren = false)
{
if (iterator.depth < depth)
return;
depth = iterator.depth;
using (new EditorGUI.DisabledScope("m_Script" == iterator.propertyPath))
{
EditorGUILayout.PropertyField(iterator, true);
}
}
}
}
}