diff --git a/Scripts/Editor/UIParticleEditor.cs b/Scripts/Editor/UIParticleEditor.cs index d9abe57..cf9ccc1 100644 --- a/Scripts/Editor/UIParticleEditor.cs +++ b/Scripts/Editor/UIParticleEditor.cs @@ -192,16 +192,10 @@ namespace Coffee.UIExtensions foreach (UIParticle t in targets) { t.RefreshParticles(); + EditorUtility.SetDirty(t); } } }; - _ro.onReorderCallback = _ => - { - foreach (UIParticle t in targets) - { - t.RefreshParticles(t.particles); - } - }; // On select UIParticle, refresh particles. foreach (UIParticle t in targets) @@ -269,9 +263,18 @@ namespace Coffee.UIExtensions EditorGUILayout.PropertyField(m_AbsoluteMode); // Target ParticleSystems. + EditorGUI.BeginChangeCheck(); + EditorGUI.BeginDisabledGroup(targets.OfType().Any(x => !x.canvas)); _ro.DoLayoutList(); - + EditorGUI.EndDisabledGroup(); serializedObject.ApplyModifiedProperties(); + if (EditorGUI.EndChangeCheck()) + { + foreach (var uip in targets.OfType()) + { + uip.RefreshParticles(uip.particles); + } + } // Does the shader support UI masks? if (current.maskable && current.GetComponentInParent())