fix: error on drag prefab to scene

close #211
pull/225/head
mob-sakai 2022-06-28 14:26:09 +09:00
parent b2b2b0f767
commit fa2f867bca
1 changed files with 7 additions and 2 deletions

View File

@ -62,7 +62,7 @@ namespace Coffee.UIExtensions
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();
@ -73,6 +73,8 @@ namespace Coffee.UIExtensions
for (var i = 0; i < s_ActiveParticles.Count; i++)
{
var uip = s_ActiveParticles[i];
if (!uip || !uip.canvas) continue;
uip.UpdateTransformScale();
if (!uip.useMeshSharing)
@ -97,7 +99,10 @@ namespace Coffee.UIExtensions
// 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();
}
}