mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 22:10:11 -05:00
VRM10MetaEditor
This commit is contained in:
@@ -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)
|
||||
|
||||
22
Assets/VRM10/Editor/Components/VRM10MetaEditor.cs
Normal file
22
Assets/VRM10/Editor/Components/VRM10MetaEditor.cs
Normal file
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/VRM10/Editor/Components/VRM10MetaEditor.cs.meta
Normal file
11
Assets/VRM10/Editor/Components/VRM10MetaEditor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea2bc7cd57762f747bb03606c307cdcf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user