diff --git a/CHANGELOG.md b/CHANGELOG.md index 55affbc..fc96f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [3.0.0-preview.35](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.34...v3.0.0-preview.35) (2020-09-27) + + +### Bug Fixes + +* an error happens during loading scene in editor ([ab9d9aa](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/ab9d9aa7b3afcdbdda00004f7af3fd4827aaea54)), closes [#101](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/101) + # [3.0.0-preview.34](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.33...v3.0.0-preview.34) (2020-09-15) diff --git a/Scripts/UIParticle.cs b/Scripts/UIParticle.cs index 93d2bab..ef08421 100755 --- a/Scripts/UIParticle.cs +++ b/Scripts/UIParticle.cs @@ -411,6 +411,7 @@ private void InitializeIfNeeded() #if UNITY_EDITOR void ISerializationCallbackReceiver.OnBeforeSerialize() { + if (Application.isPlaying) return; InitializeIfNeeded(); } @@ -418,7 +419,8 @@ void ISerializationCallbackReceiver.OnAfterDeserialize() { UnityEditor.EditorApplication.delayCall += () => { - if (this) InitializeIfNeeded(); + if (Application.isPlaying || !this) return; + InitializeIfNeeded(); }; } #endif diff --git a/package.json b/package.json index ca0cd42..fecb6be 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.coffee.ui-particle", "displayName": "UI Particle", "description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.", - "version": "3.0.0-preview.34", + "version": "3.0.0-preview.35", "unity": "2018.2", "license": "MIT", "repository": {