Skip to content

Commit

Permalink
fix: error on drag prefab to scene
Browse files Browse the repository at this point in the history
close #211
  • Loading branch information
mob-sakai committed Jun 28, 2022
1 parent b2b2b0f commit fa2f867
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Scripts/UIParticleUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static void Refresh()
for (var i = 0; i < s_ActiveParticles.Count; i++)
{
var uip = s_ActiveParticles[i];
if (!uip.isPrimary || s_UpdatedGroupIds.Contains(uip.groupId)) continue;
if (!uip || !uip.canvas || !uip.isPrimary || s_UpdatedGroupIds.Contains(uip.groupId)) continue;

s_UpdatedGroupIds.Add(uip.groupId);
uip.UpdateTransformScale();
Expand All @@ -73,6 +73,8 @@ private static void Refresh()
for (var i = 0; i < s_ActiveParticles.Count; i++)
{
var uip = s_ActiveParticles[i];
if (!uip || !uip.canvas) continue;

uip.UpdateTransformScale();

if (!uip.useMeshSharing)
Expand All @@ -97,7 +99,10 @@ private static void Refresh()
// UpdateParticleCount.
for (var i = 0; i < s_ActiveParticles.Count; i++)
{
s_ActiveParticles[i].UpdateParticleCount();
var uip = s_ActiveParticles[i];
if (!uip || !uip.canvas) continue;

uip.UpdateParticleCount();
}
}

Expand Down

0 comments on commit fa2f867

Please sign in to comment.