From b4131c4bada6052bd5f5706db81467383eec240b Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 21 Jun 2021 18:34:39 +0900 Subject: [PATCH] VRM10MetaEditor --- .../SerializedPropertyEditor.cs | 6 ++--- .../Editor/Components/VRM10MetaEditor.cs | 22 +++++++++++++++++++ .../Editor/Components/VRM10MetaEditor.cs.meta | 11 ++++++++++ .../Editor/Components/VRM10ObjectEditor.cs | 7 ++---- 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 Assets/VRM10/Editor/Components/VRM10MetaEditor.cs create mode 100644 Assets/VRM10/Editor/Components/VRM10MetaEditor.cs.meta diff --git a/Assets/UniGLTF/Editor/SerializedPropertyEditor/SerializedPropertyEditor.cs b/Assets/UniGLTF/Editor/SerializedPropertyEditor/SerializedPropertyEditor.cs index cc9bdb69c..0b89b8966 100644 --- a/Assets/UniGLTF/Editor/SerializedPropertyEditor/SerializedPropertyEditor.cs +++ b/Assets/UniGLTF/Editor/SerializedPropertyEditor/SerializedPropertyEditor.cs @@ -9,12 +9,12 @@ namespace UniGLTF public class SerializedPropertyEditor { protected SerializedObject m_serializedObject; - SerializedProperty m_root; + protected SerializedProperty m_rootProperty; public SerializedPropertyEditor(SerializedObject serializedObject, SerializedProperty property) { m_serializedObject = serializedObject; - m_root = property; + m_rootProperty = property; } public static SerializedPropertyEditor Create(SerializedObject serializedObject, string name) @@ -29,7 +29,7 @@ namespace UniGLTF public void OnGUI() { - RecursiveProperty(m_root); + RecursiveProperty(m_rootProperty); } protected virtual void RecursiveProperty(SerializedProperty root) diff --git a/Assets/VRM10/Editor/Components/VRM10MetaEditor.cs b/Assets/VRM10/Editor/Components/VRM10MetaEditor.cs new file mode 100644 index 000000000..cc1c1f331 --- /dev/null +++ b/Assets/VRM10/Editor/Components/VRM10MetaEditor.cs @@ -0,0 +1,22 @@ +using UniGLTF; +using UnityEditor; + +namespace UniVRM10 +{ + public class VRM10MetaEditor : SerializedPropertyEditor + { + public VRM10MetaEditor(SerializedObject serializedObject, SerializedProperty property) : base(serializedObject, property) + { + } + + public static VRM10MetaEditor Create(SerializedObject serializedObject) + { + return new VRM10MetaEditor(serializedObject, serializedObject.FindProperty(nameof(VRM10Object.Meta))); + } + + protected override void RecursiveProperty(SerializedProperty root) + { + EditorGUILayout.LabelField("meta"); + } + } +} diff --git a/Assets/VRM10/Editor/Components/VRM10MetaEditor.cs.meta b/Assets/VRM10/Editor/Components/VRM10MetaEditor.cs.meta new file mode 100644 index 000000000..28bcb0260 --- /dev/null +++ b/Assets/VRM10/Editor/Components/VRM10MetaEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea2bc7cd57762f747bb03606c307cdcf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10/Editor/Components/VRM10ObjectEditor.cs b/Assets/VRM10/Editor/Components/VRM10ObjectEditor.cs index d6ba4f3a7..cfdb7329e 100644 --- a/Assets/VRM10/Editor/Components/VRM10ObjectEditor.cs +++ b/Assets/VRM10/Editor/Components/VRM10ObjectEditor.cs @@ -1,8 +1,5 @@ -using System; -using System.IO; -using UniGLTF; +using UniGLTF; using UnityEditor; -using UnityEngine; namespace UniVRM10 { @@ -36,7 +33,7 @@ namespace UniVRM10 m_target = (VRM10Object)target; m_expression = SerializedPropertyEditor.Create(serializedObject, nameof(m_target.Expression)); - m_meta = SerializedPropertyEditor.Create(serializedObject, nameof(m_target.Meta)); + m_meta = VRM10MetaEditor.Create(serializedObject); m_lookAt = SerializedPropertyEditor.Create(serializedObject, nameof(m_target.LookAt)); m_firstPerson = SerializedPropertyEditor.Create(serializedObject, nameof(m_target.FirstPerson)); }