diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs index f0616bc3a..8972f31a7 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/WarpEditor.cs @@ -1,3 +1,6 @@ +using System; +using System.Collections.Generic; +using System.Linq; using UnityEditor; using UnityEditor.UIElements; using UnityEngine; @@ -11,6 +14,7 @@ namespace RotateParticle.Components { private Warp m_target; private Vrm10Instance m_vrm; + private Transform[] m_items; void OnEnable() { @@ -18,8 +22,10 @@ namespace RotateParticle.Components { return; } + m_target = (Warp)target; m_vrm = m_target.GetComponentInParent(); + m_items = m_target.GetComponentsInChildren().Skip(1).ToArray(); } // public override void OnInspectorGUI() @@ -46,17 +52,72 @@ namespace RotateParticle.Components { 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); + { + 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) }); + { + + var listview = new MultiColumnListView(); + listview.columns.Add(new Column + { + title = "Transform", + width = 80, + makeCell = () => new ObjectField(), + bindCell = (v, i) => + { + v.SetEnabled(false); + (v as ObjectField).value = m_items[i]; + }, + }); + listview.columns.Add(new Column + { + title = "Mode", + width = 60, + makeCell = () => new EnumField(default(Warp.ParticleMode)), + }); + listview.columns.Add(new Column + { + title = "stiffnessForce", + width = 20, + makeCell = () => new FloatField(), + }); + listview.columns.Add(new Column + { + title = "gravityPower", + width = 20, + makeCell = () => new FloatField(), + }); + listview.columns.Add(new Column + { + title = "gravityDir", + width = 20, + makeCell = () => new Vector3Field(), + }); + listview.columns.Add(new Column + { + title = "dragForce", + width = 20, + makeCell = () => new FloatField(), + }); + listview.columns.Add(new Column + { + title = "radius", + width = 20, + makeCell = () => new FloatField(), + }); + + listview.itemsSource = m_items; + root.Add(listview); + } + root.Add(new PropertyField { bindingPath = nameof(Warp.ColliderGroups) }); return root; diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs index 609ca2bf2..f7d67a89c 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs @@ -23,6 +23,22 @@ namespace RotateParticle.Components }; } + public enum ParticleMode + { + /// + /// Use BaseSettings + /// + UseBase, + /// + /// Use specific settings + /// + Override, + /// + /// no animation + /// + Disabled, + } + /// /// VRM10SpringBoneJoint に相当する ///