fix: unintended scaling occurs when `AutoScalingMode=UIParticle` and `ScalingMode=Local`

close #292
pull/310/head
mob-sakai 2024-01-26 20:34:59 +09:00
parent 293dc43db7
commit e32077fb0d
1 changed files with 7 additions and 0 deletions

View File

@ -515,6 +515,13 @@ namespace Coffee.UIExtensions
{ {
Profiler.BeginSample("[UIParticleRenderer] GetWorldScale"); Profiler.BeginSample("[UIParticleRenderer] GetWorldScale");
var scale = _parent.scale3DForCalc.GetScaled(_parent.parentScale); var scale = _parent.scale3DForCalc.GetScaled(_parent.parentScale);
if (_parent.autoScalingMode == UIParticle.AutoScalingMode.UIParticle
&& _particleSystem.main.scalingMode == ParticleSystemScalingMode.Local)
{
scale = scale.GetScaled(_parent.canvas.transform.localScale);
}
Profiler.EndSample(); Profiler.EndSample();
return scale; return scale;
} }