diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs index 5d5c60a6b..f0616bc3a 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs @@ -1,5 +1,7 @@ using UnityEditor; +using UnityEditor.UIElements; using UnityEngine; +using UnityEngine.UIElements; using UniVRM10; namespace RotateParticle.Components @@ -20,24 +22,44 @@ namespace RotateParticle.Components m_vrm = m_target.GetComponentInParent(); } - public override void OnInspectorGUI() + // public override void OnInspectorGUI() + // { + // var n = EditorUtility.GetDirtyCount(m_target.GetInstanceID()); + // base.OnInspectorGUI(); + // if (n != EditorUtility.GetDirtyCount(m_target.GetInstanceID())) + // { + // if (m_vrm != null) + // { + // if (Application.isPlaying) + // { + // m_vrm.Runtime.SpringBone.SetJointLevel(m_target.transform, m_target.BaseSettings); + // foreach (var p in m_target.Particles) + // { + // m_vrm.Runtime.SpringBone.SetJointLevel(p.Transform, p.GetSettings(m_target.BaseSettings)); + // } + // } + // } + // } + // } + + public override VisualElement CreateInspectorGUI() { - var n = EditorUtility.GetDirtyCount(m_target.GetInstanceID()); - base.OnInspectorGUI(); - if (n != EditorUtility.GetDirtyCount(m_target.GetInstanceID())) - { - if (m_vrm != null) - { - if (Application.isPlaying) - { - m_vrm.Runtime.SpringBone.SetJointLevel(m_target.transform, m_target.BaseSettings); - foreach (var p in m_target.Particles) - { - m_vrm.Runtime.SpringBone.SetJointLevel(p.Transform, p.GetSettings(m_target.BaseSettings)); - } - } - } - } + var root = new VisualElement(); + + // var container = new IMGUIContainer(OnInspectorGUI); + // root.Add(container); + + root.Bind(serializedObject); + + var s = new PropertyField { bindingPath = "m_Script" }; + s.SetEnabled(false); + root.Add(s); + root.Add(new PropertyField { bindingPath = nameof(Warp.BaseSettings) }); + root.Add(new PropertyField { bindingPath = nameof(Warp.Center) }); + root.Add(new PropertyField { bindingPath = nameof(Warp.Particles) }); + root.Add(new PropertyField { bindingPath = nameof(Warp.ColliderGroups) }); + + return root; } } } \ No newline at end of file diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs index dca1527fa..2f868d2d4 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs @@ -225,7 +225,7 @@ namespace RotateParticle.Jobs Warps = _warps, Info = _info, NextPositions = _nextPositions, - }.Schedule(_warps.Length, 1, handle); + }.Schedule(_warps.Length, 16, handle); // collision handle = new CollisionJob @@ -244,7 +244,7 @@ namespace RotateParticle.Jobs CurrentTransforms = _inputData, NextPositions = _nextPositions, NextRotations = _nextRotations, - }.Schedule(_warps.Length, 1, handle); + }.Schedule(_warps.Length, 16, handle); // output handle = new OutputTransformJob