Skip to content

Commit

Permalink
fix: if the UIParticle parents do not have Canvas, an exception is th…
Browse files Browse the repository at this point in the history
…rown in OnEnable

close #300
  • Loading branch information
mob-sakai committed Apr 4, 2024
1 parent 2ec3748 commit e82c833
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Packages/src/Runtime/UIParticleRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ private Vector3 GetWorldScale()
var scale = _parent.scale3DForCalc.GetScaled(_parent.parentScale);

if (_parent.autoScalingMode == UIParticle.AutoScalingMode.UIParticle
&& _particleSystem.main.scalingMode == ParticleSystemScalingMode.Local)
&& _particleSystem.main.scalingMode == ParticleSystemScalingMode.Local
&& _parent.canvas)
{
scale = scale.GetScaled(_parent.canvas.transform.localScale);
}
Expand Down

0 comments on commit e82c833

Please sign in to comment.