From ae42e96d850641ce9c0903756becb983f9cecec1 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 11 Mar 2025 16:27:24 +0900 Subject: [PATCH] WIP uxml --- .../VRM10Viewer/UIToolkit/EmotionElement.cs | 32 ++++++++----- .../VRM10Viewer/UIToolkit/EmotionElement.uxml | 12 ++++- .../UIToolkit/ExpressionElement.cs | 24 ++++++++++ .../UIToolkit/ExpressionElement.cs.meta | 11 +++++ .../UIToolkit/ExpressionElement.uxml | 6 +++ .../UIToolkit/ExpressionElement.uxml.meta | 10 ++++ .../VRM10Viewer/UIToolkit/MainView.uxml | 47 +++++++++++-------- .../VRM10Viewer/UIToolkit/MetaView.uxml | 9 ++++ .../VRM10Viewer/UIToolkit/MetaView.uxml.meta | 10 ++++ 9 files changed, 129 insertions(+), 32 deletions(-) create mode 100644 Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs create mode 100644 Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs.meta create mode 100644 Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml create mode 100644 Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml.meta create mode 100644 Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml create mode 100644 Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml.meta diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.cs b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.cs index aa40bd434..92e4b4990 100644 --- a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.cs +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.cs @@ -1,21 +1,31 @@ using System.Collections.Generic; using UnityEngine.UIElements; - public class EmotionElement : VisualElement +public class EmotionElement : VisualElement +{ + Slider _slider; + public EmotionElement() { - public EmotionElement() { } + } + public void Init() + { + _slider = this.Q("Slider"); + } - public new class UxmlFactory : UxmlFactory { } + public new class UxmlFactory : UxmlFactory { } - public new class UxmlTraits : VisualElement.UxmlTraits + public new class UxmlTraits : VisualElement.UxmlTraits + { + UxmlStringAttributeDescription m_label = new UxmlStringAttributeDescription { name = "label" }; + + public override IEnumerable uxmlChildElementsDescription { - public override IEnumerable uxmlChildElementsDescription - { - get { yield break; } - } + get { yield break; } + } - public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) - { - } + public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) + { + base.Init(ve, bag, cc); } } +} diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.uxml b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.uxml index 292436255..98f731057 100644 --- a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.uxml +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.uxml @@ -1,5 +1,13 @@ - - + + + + + + + + + + diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs new file mode 100644 index 000000000..995abc5af --- /dev/null +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using UnityEngine.UIElements; + +public class ExpressionElement : VisualElement +{ + public ExpressionElement() { } + + public new class UxmlFactory : UxmlFactory { } + + public new class UxmlTraits : VisualElement.UxmlTraits + { + UxmlStringAttributeDescription m_label = new UxmlStringAttributeDescription { name = "label" }; + + public override IEnumerable uxmlChildElementsDescription + { + get { yield break; } + } + + public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) + { + base.Init(ve, bag, cc); + } + } +} diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs.meta b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs.meta new file mode 100644 index 000000000..1f86714b1 --- /dev/null +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d5015e0eadc5974d8405eed49f0883c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml new file mode 100644 index 000000000..d2c7ffed9 --- /dev/null +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml @@ -0,0 +1,6 @@ + + + + + + diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml.meta b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml.meta new file mode 100644 index 000000000..724d480ca --- /dev/null +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ExpressionElement.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f16ec41d6ac2e364f92a4de67b3f972a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml index 292f4098f..efa5dd195 100644 --- a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml @@ -1,29 +1,38 @@ - + - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml new file mode 100644 index 000000000..826a60b28 --- /dev/null +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml.meta b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml.meta new file mode 100644 index 000000000..f4e179272 --- /dev/null +++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fc89bbe262d980f4a9695319d2f9ed75 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}