From 1b5c359058289895caf5f245fe09abb643bc38eb Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Wed, 22 May 2024 17:11:38 +0900 Subject: [PATCH] fix: assertion failed on expression: 'ps->array_size()' close #278 --- Packages/src/Runtime/UIParticleRenderer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Packages/src/Runtime/UIParticleRenderer.cs b/Packages/src/Runtime/UIParticleRenderer.cs index 33caca3..622db7d 100644 --- a/Packages/src/Runtime/UIParticleRenderer.cs +++ b/Packages/src/Runtime/UIParticleRenderer.cs @@ -329,6 +329,14 @@ namespace Coffee.UIExtensions // Bake mesh. Profiler.BeginSample("[UIParticleRenderer] Bake Mesh"); s_CombineInstances[0].mesh.Clear(false); + + // Assertion failed on expression: 'ps->array_size()' #278 + var extends = s_CombineInstances[0].mesh.bounds.extents.x; + if (!float.IsNaN(extends) && !float.IsInfinity(extends) && 0 < extends) + { + s_CombineInstances[0].mesh.RecalculateBounds(); + } + if (_isTrail && _parent.canSimulate && 0 < _particleSystem.particleCount) { #if PS_BAKE_API_V2