This commit is contained in:
ousttrue
2025-03-11 16:27:24 +09:00
parent 2049eb05ed
commit ae42e96d85
9 changed files with 129 additions and 32 deletions

View File

@@ -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>("Slider");
}
public new class UxmlFactory : UxmlFactory<EmotionElement, UxmlTraits> { }
public new class UxmlFactory : UxmlFactory<EmotionElement, UxmlTraits> { }
public new class UxmlTraits : VisualElement.UxmlTraits
public new class UxmlTraits : VisualElement.UxmlTraits
{
UxmlStringAttributeDescription m_label = new UxmlStringAttributeDescription { name = "label" };
public override IEnumerable<UxmlChildElementDescription> uxmlChildElementsDescription
{
public override IEnumerable<UxmlChildElementDescription> 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);
}
}
}

View File

@@ -1,5 +1,13 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<EmotionElement>
<ui:Button text="Button" parse-escape-sequences="true" display-tooltip-when-elided="true" />
<EmotionElement style="flex-shrink: 0;">
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
<ui:Slider label="Slider" high-value="100" name="Slider" style="flex-shrink: 1; flex-grow: 1;" />
<ui:Toggle label="Toggle" />
</ui:VisualElement>
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
<ui:DropdownField style="flex-shrink: 1; flex-grow: 1;" />
<ui:DropdownField style="flex-shrink: 1; flex-grow: 1;" />
<ui:DropdownField style="flex-shrink: 1; flex-grow: 1;" />
</ui:VisualElement>
</EmotionElement>
</ui:UXML>

View File

@@ -0,0 +1,24 @@
using System.Collections.Generic;
using UnityEngine.UIElements;
public class ExpressionElement : VisualElement
{
public ExpressionElement() { }
public new class UxmlFactory : UxmlFactory<ExpressionElement, UxmlTraits> { }
public new class UxmlTraits : VisualElement.UxmlTraits
{
UxmlStringAttributeDescription m_label = new UxmlStringAttributeDescription { name = "label" };
public override IEnumerable<UxmlChildElementDescription> uxmlChildElementsDescription
{
get { yield break; }
}
public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
{
base.Init(ve, bag, cc);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4d5015e0eadc5974d8405eed49f0883c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,6 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<ExpressionElement style="flex-shrink: 0; flex-direction: row;">
<ui:Slider label="Slider" name="Slider" high-value="100" style="flex-shrink: 1; flex-grow: 1;" />
<ui:Toggle />
</ExpressionElement>
</ui:UXML>

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f16ec41d6ac2e364f92a4de67b3f972a
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}

View File

@@ -1,29 +1,38 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
<ui:Template name="EmotionElement" src="./EmotionElement.uxml"/>
<ui:Template name="EmotionElement" src="project://database/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/EmotionElement.uxml?fileID=9197481963319205126&amp;guid=e877eb3dcb0d99e4a99d40156a476bce&amp;type=3#EmotionElement" />
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
<ui:VisualElement name="left" style="flex-grow: 0; min-width: 200px; background-color: rgba(255, 255, 255, 0.35);">
<ui:Toggle label="Show BoxMan" name="ShowBoxMan" value="true" />
<ui:Button text="Open Model" parse-escape-sequences="true" display-tooltip-when-elided="true" name="OpenModel" />
<ui:Toggle label="Use Async" name="UseAsync" style="flex-direction: row-reverse;" />
<ui:Label tabindex="-1" text="Motion" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__Motion__" style="-unity-font-style: bold;" />
<ui:Toggle label="T-Pose" name="UseTPose" style="flex-direction: row-reverse;" />
<ui:Label tabindex="-1" text="SpringBone" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__SpringBone__" style="-unity-font-style: bold;" />
<ui:Toggle label="Singelton" name="UseSpringboneSingleton" style="flex-direction: row-reverse;" />
<ui:Toggle label="Use CustomMToonMaterial" name="UseCustomMToonMaterial" style="flex-direction: row-reverse;" />
<ui:Toggle label="Show BoxMan" name="ShowBoxMan" value="true" style="flex-direction: row-reverse;" />
<ui:Label tabindex="-1" text="Model" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__Model__" style="-unity-font-style: bold; -unity-text-align: upper-center;" />
<ui:Toggle label="Use CustomPbrMaterial" name="UseCustomPbrMaterial" value="true" style="flex-direction: row-reverse;" />
<ui:Toggle label="Use CustomMToonMaterial" name="UseCustomMToonMaterial" style="flex-direction: row-reverse;" />
<ui:Button text="Open Model" parse-escape-sequences="true" display-tooltip-when-elided="true" name="OpenModel" />
<ui:Label tabindex="-1" text="ImportOption" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__ImportOption__" style="-unity-font-style: bold; -unity-text-align: upper-center;" />
<ui:Toggle label="Use Async" name="UseAsync" style="flex-direction: row-reverse;" />
<ui:Label tabindex="-1" text="Motion" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__Motion__" style="-unity-font-style: bold; -unity-text-align: upper-center;" />
<ui:Button text="Open Motion" parse-escape-sequences="true" display-tooltip-when-elided="true" name="OpenMotion" />
<ui:Button text="Paste Pose" parse-escape-sequences="true" display-tooltip-when-elided="true" name="PastePose" />
<ui:RadioButtonGroup value="1" name="MotionMode" choices="T-Pose,BVH" />
<ui:Label tabindex="-1" text="SpringBone" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__SpringBone__" style="-unity-font-style: bold; -unity-text-align: upper-center;" />
<ui:Toggle label="Singelton" name="UseSpringboneSingleton" style="flex-direction: row-reverse;" />
<ui:Toggle label="Pause" name="UeSpringbonePause" style="flex-direction: row-reverse;" />
<ui:Toggle label="Support Scaling" name="UseSpringboneScaling" style="flex-direction: row-reverse;" />
<ui:Slider label="ExternalX" high-value="10" name="SpringboneExternalX" />
<ui:Slider label="ExternalY" high-value="10" name="SpringboneExternalY" />
<ui:Slider label="ExternalZ" high-value="10" name="SpringboneExternalZ" />
<ui:Toggle label="Pause" name="UeSpringbonePause" />
<ui:Toggle label="Support Scaling" name="UseSpringboneScaling" />
<ui:Label tabindex="-1" text="Expression" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__Expression__" style="-unity-font-style: bold;" />
<ui:Toggle label="Toggle" />
<ui:Toggle label="Toggle" />
<ui:Label tabindex="-1" text="LookAt" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__LookAt__" style="-unity-font-style: bold;" />
<ui:Toggle label="Toggle" />
<ui:Slider label="Slider" high-value="100" />
<ui:Slider label="Slider" high-value="100" />
<ui:Instance template="EmotionElement"/>
<ui:Label tabindex="-1" text="Expression" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__Expression__" style="-unity-font-style: bold; -unity-text-align: upper-center;" />
<ui:Toggle label="AutoEmotions" name="AutoEmotions" style="flex-direction: row-reverse;" />
<ui:Instance template="EmotionElement" name="Happy" style="flex-shrink: 0;" />
<ui:Instance template="EmotionElement" name="Angry" style="flex-shrink: 0;" />
<ui:Instance template="EmotionElement" name="Sad" style="flex-shrink: 0;" />
<ui:Instance template="EmotionElement" name="Relaxed" style="flex-shrink: 0;" />
<ui:Instance template="EmotionElement" name="Surprised" style="flex-shrink: 0;" />
<ui:Toggle label="AutoLipSync" name="AutoLipsync" />
<ui:Toggle label="AutoBlink" name="AutoBlink" />
<ui:Label tabindex="-1" text="LookAt" parse-escape-sequences="true" display-tooltip-when-elided="true" name="__LookAt__" style="-unity-font-style: bold; -unity-text-align: upper-center;" />
<ui:Toggle label="Lookat Target" name="LookatTarget" />
<ui:Slider label="Yaw" high-value="100" />
<ui:Slider label="Pitch" high-value="100" />
</ui:VisualElement>
<ui:VisualElement name="right" style="flex-grow: 1;" />
</ui:VisualElement>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<engine:UXML
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:engine="UnityEngine.UIElements"
xmlns:editor="UnityEditor.UIElements"
xsi:noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd"
>
</engine:UXML>

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: fc89bbe262d980f4a9695319d2f9ed75
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}