diff --git a/Packages/UIParticle/Scripts/Editor/UIParticleEditor.cs b/Packages/UIParticle/Scripts/Editor/UIParticleEditor.cs index 3e19277..cc4ce86 100644 --- a/Packages/UIParticle/Scripts/Editor/UIParticleEditor.cs +++ b/Packages/UIParticle/Scripts/Editor/UIParticleEditor.cs @@ -149,8 +149,17 @@ public override void OnInspectorGUI() .Select(x => x.GetComponent().sharedMaterial) .Where(x => x) .ToArray(); + + // Animated properties + EditorGUI.BeginChangeCheck(); AnimatedPropertiesEditor.DrawAnimatableProperties(_spAnimatableProperties, mats); + if (EditorGUI.EndChangeCheck()) + { + foreach (UIParticle t in targets) + t.SetMaterialDirty(); + } + // Target ParticleSystems. _ro.DoLayoutList(); serializedObject.ApplyModifiedProperties(); diff --git a/Packages/UIParticle/Scripts/UIParticle.cs b/Packages/UIParticle/Scripts/UIParticle.cs index 6a826d0..995166f 100755 --- a/Packages/UIParticle/Scripts/UIParticle.cs +++ b/Packages/UIParticle/Scripts/UIParticle.cs @@ -432,6 +432,14 @@ private void InitializeIfNeeded() } #if UNITY_EDITOR + protected override void OnValidate() + { + SetLayoutDirty(); + SetVerticesDirty(); + m_ShouldRecalculateStencil = true; + RecalculateClipping(); + } + void ISerializationCallbackReceiver.OnBeforeSerialize() { if (Application.isPlaying) return;