From d1386a12216743a6e09f1b9b87bea1dfcf7702e4 Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Fri, 5 Dec 2025 09:58:23 +0900 Subject: [PATCH 1/3] fix: add early return for case where subEmitter module is disabled --- Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs b/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs index 709fce8..4bd5c69 100644 --- a/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs +++ b/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs @@ -190,6 +190,8 @@ namespace Coffee.UIParticleInternal if (!self || !parent) return false; var subEmitters = parent.subEmitters; + if (!subEmitters.enabled) return false; // No sub emitters. + var count = subEmitters.subEmittersCount; for (var i = 0; i < count; i++) { From eb2e862e80e549c8cf16ddfed776c101c2413bac Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Wed, 24 Dec 2025 20:10:01 +0900 Subject: [PATCH 2/3] fix: avoid endless loop close #392 --- Assets/Tests/Editor/NewTestScript.cs | 13 +++++++++---- Packages/src/Runtime/UIParticle.cs | 1 + .../Runtime/Utilities/ParticleSystemExtensions.cs | 6 +----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Assets/Tests/Editor/NewTestScript.cs b/Assets/Tests/Editor/NewTestScript.cs index 9de2f92..0556565 100644 --- a/Assets/Tests/Editor/NewTestScript.cs +++ b/Assets/Tests/Editor/NewTestScript.cs @@ -1,16 +1,21 @@ using System.Collections; +using Coffee.UIParticleInternal; using NUnit.Framework; +using UnityEngine; using UnityEngine.TestTools; namespace Coffee.UIParticle.Editor.Tests { public class NewTestScript { - // A Test behaves as an ordinary method - [Test] - public void NewTestScriptSimplePasses() + [TestCase(-1)] + [TestCase(0)] + [TestCase(2048)] + [TestCase(3000)] + public void GetParticleArray(int requiredSize) { - // Use the Assert class to test conditions + var array = ParticleSystemExtensions.GetParticleArray(requiredSize); + Debug.Log($"requiredSize: {requiredSize}, array.Length: {array.Length}"); } // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use diff --git a/Packages/src/Runtime/UIParticle.cs b/Packages/src/Runtime/UIParticle.cs index b2c079b..5c0e4f7 100644 --- a/Packages/src/Runtime/UIParticle.cs +++ b/Packages/src/Runtime/UIParticle.cs @@ -9,6 +9,7 @@ using UnityEngine.UI; using Random = UnityEngine.Random; [assembly: InternalsVisibleTo("Coffee.UIParticle.Editor")] +[assembly: InternalsVisibleTo("Coffee.UIParticle.Editor.Tests")] [assembly: InternalsVisibleTo("Coffee.UIParticle.PerformanceDemo")] [assembly: InternalsVisibleTo("Coffee.UIParticle.Demo")] diff --git a/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs b/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs index 4bd5c69..7fec948 100644 --- a/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs +++ b/Packages/src/Runtime/Utilities/ParticleSystemExtensions.cs @@ -13,11 +13,7 @@ namespace Coffee.UIParticleInternal { if (s_TmpParticles.Length < size) { - while (s_TmpParticles.Length < size) - { - size = Mathf.NextPowerOfTwo(size); - } - + size = Mathf.NextPowerOfTwo(size); s_TmpParticles = new ParticleSystem.Particle[size]; } From fed927559f4f4a3184d447e248af5b4fe6ecdd80 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 24 Dec 2025 11:17:10 +0000 Subject: [PATCH 3/3] chore(release): 4.11.4 [skip ci] ## [4.11.4](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.11.3...v4.11.4) (2025-12-24) ### Bug Fixes * add early return for case where subEmitter module is disabled ([d1386a1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/d1386a12216743a6e09f1b9b87bea1dfcf7702e4)) * avoid endless loop ([eb2e862](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/eb2e862e80e549c8cf16ddfed776c101c2413bac)), closes [#392](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/392) --- Packages/src/CHANGELOG.md | 8 ++++++++ Packages/src/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Packages/src/CHANGELOG.md b/Packages/src/CHANGELOG.md index 334789d..7ef86b5 100644 --- a/Packages/src/CHANGELOG.md +++ b/Packages/src/CHANGELOG.md @@ -1,3 +1,11 @@ +## [4.11.4](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.11.3...v4.11.4) (2025-12-24) + + +### Bug Fixes + +* add early return for case where subEmitter module is disabled ([d1386a1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/d1386a12216743a6e09f1b9b87bea1dfcf7702e4)) +* avoid endless loop ([eb2e862](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/eb2e862e80e549c8cf16ddfed776c101c2413bac)), closes [#392](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/392) + ## [4.11.3](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.11.2...v4.11.3) (2025-10-14) diff --git a/Packages/src/package.json b/Packages/src/package.json index 10d159c..ba29c86 100644 --- a/Packages/src/package.json +++ b/Packages/src/package.json @@ -2,7 +2,7 @@ "name": "com.coffee.ui-particle", "displayName": "UI Particle", "description": "This package provides a component to render particle effects for uGUI.\nThe particle rendering is maskable and sortable, without the need for an extra Camera, RenderTexture, or Canvas.", - "version": "4.11.3", + "version": "4.11.4", "unity": "2018.2", "license": "MIT", "repository": {