You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
fix: in rare cases, an IndexOutOfRangeException is thrown
This commit is contained in:
@@ -256,6 +256,7 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
// Main
|
// Main
|
||||||
var index = i * 2;
|
var index = i * 2;
|
||||||
|
if (activeMeshIndices.Count <= index) break;
|
||||||
if (activeMeshIndices[index] && 0 < s_TempMaterials.Count)
|
if (activeMeshIndices[index] && 0 < s_TempMaterials.Count)
|
||||||
{
|
{
|
||||||
var mat = GetModifiedMaterial(s_TempMaterials[0], ps.GetTextureForSprite());
|
var mat = GetModifiedMaterial(s_TempMaterials[0], ps.GetTextureForSprite());
|
||||||
@@ -266,7 +267,7 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
// Trails
|
// Trails
|
||||||
index++;
|
index++;
|
||||||
if (materialCount <= j) break;
|
if (activeMeshIndices.Count <= index || materialCount <= j) break;
|
||||||
if (activeMeshIndices[index] && 1 < s_TempMaterials.Count)
|
if (activeMeshIndices[index] && 1 < s_TempMaterials.Count)
|
||||||
{
|
{
|
||||||
var mat = GetModifiedMaterial(s_TempMaterials[1], null);
|
var mat = GetModifiedMaterial(s_TempMaterials[1], null);
|
||||||
|
|||||||
Reference in New Issue
Block a user