using System; using UniGLTF; using UniGLTF.SpringBoneJobs.Blittables; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.UIElements; namespace UniVRM10.VRM10Viewer { public class VRM10MainView : MonoBehaviour { [SerializeField] VRM10ViewerController m_controller = new(); VisualElement m_root; // left Toggle m_useAsync; Toggle m_useSpringboneSingleton; Toggle m_useCustomPbrMaterial; Toggle m_useCustomMToonMaterial; RadioButtonGroup m_motionMode; Slider m_springboneExternalX; Slider m_springboneExternalY; Slider m_springboneExternalZ; Toggle m_useSpringbonePause; Toggle m_useSpringboneScaling; Toggle m_showBoxMan; Toggle m_enableAutoExpression; EmotionElement m_happy; EmotionElement m_angry; EmotionElement m_sad; EmotionElement m_relaxed; EmotionElement m_surprised; Toggle m_enableAutoLipsync; ExpressionElement m_lipAa; ExpressionElement m_lipIh; ExpressionElement m_lipOu; ExpressionElement m_lipEe; ExpressionElement m_lipOh; Toggle m_enableAutoBlink; ExpressionElement m_blink; Toggle m_enableLookatTarget; Slider m_yaw; Slider m_pitch; // right TextField m_metaName; TextField m_metaVersion; TextField m_metaAuthor; TextField m_metaCopyright; TextField m_metaContact; TextField m_metaReference; TextureElement m_metaThumbnail; TextField m_metaPermissionAllowed; TextField m_metaPermissionViolent; TextField m_metaPermissionSexual; TextField m_metaPermissionCommercial; TextField m_metaLicense; TextField m_metaDistribution; // runtime VRM10AutoExpression m_autoEmotion; VRM10Blinker m_autoBlink; VRM10AIUEO m_autoLipsync; void QueryOrAssert(out T dst, VisualElement root, string name) where T : VisualElement { dst = root.Q(name); Debug.Assert(dst != null, name); } void OnEnable() { // The UXML is already instantiated by the UIDocument component var uiDocument = GetComponent(); var root = uiDocument.rootVisualElement; m_root = root; root.Q