From c75ca8663fedb24cf2b1210a23bbc076f65f8919 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Mon, 14 Aug 2023 15:33:19 +0900 Subject: [PATCH] fix: crash occurs when too many vertices are rendered --- Scripts/UIParticleRenderer.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Scripts/UIParticleRenderer.cs b/Scripts/UIParticleRenderer.cs index de0823b..d05861e 100644 --- a/Scripts/UIParticleRenderer.cs +++ b/Scripts/UIParticleRenderer.cs @@ -276,6 +276,18 @@ namespace Coffee.UIExtensions { s_CombineInstances[0].mesh.Clear(false); } + + // Too many vertices to render. + if (65535 <= s_CombineInstances[0].mesh.vertexCount) + { + s_CombineInstances[0].mesh.Clear(false); + UnityEngine.Debug.LogErrorFormat(this, + "Too many vertices to render. index={0}, isTrail={1}, vertexCount={2}(>=65535)", + _index, + _isTrail, + s_CombineInstances[0].mesh.vertexCount + ); + } Profiler.EndSample(); // Combine mesh to transform. ([ParticleSystem local ->] world -> renderer local)