From f6e64c325b37fe1141a36317a958a68741a8a607 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Tue, 26 Feb 2019 11:26:56 +0900 Subject: [PATCH] close #45; Disable ParticleSystemRenderer on reset --- Scripts/UIParticle.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Scripts/UIParticle.cs b/Scripts/UIParticle.cs index d5bd598..8eaaebe 100755 --- a/Scripts/UIParticle.cs +++ b/Scripts/UIParticle.cs @@ -255,6 +255,21 @@ namespace Coffee.UIExtensions base.OnDisable (); } +#if UNITY_EDITOR + /// + /// Reset to default values. + /// + protected override void Reset () + { + // Disable ParticleSystemRenderer on reset. + if (cachedParticleSystem) + { + cachedParticleSystem.GetComponent ().enabled = false; + } + base.Reset (); + } +#endif + /// /// Call to update the geometry of the Graphic onto the CanvasRenderer. ///