From e82c833d04b819f103984931ba29a3616ef50908 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Thu, 4 Apr 2024 15:59:12 +0900 Subject: [PATCH] fix: if the UIParticle parents do not have Canvas, an exception is thrown in OnEnable close #300 --- Packages/src/Runtime/UIParticleRenderer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Packages/src/Runtime/UIParticleRenderer.cs b/Packages/src/Runtime/UIParticleRenderer.cs index a428b66e..56d60bf6 100644 --- a/Packages/src/Runtime/UIParticleRenderer.cs +++ b/Packages/src/Runtime/UIParticleRenderer.cs @@ -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); }