You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
feat: add 'AutoScaling' option for UIParticle
Transform.lossyScale (=world scale) is automatically set to (1, 1, 1). It prevents the root-Canvas scale from affecting the hierarchy-scaled ParticleSystem. This option works in reverse of ’IgnoreCanvasScaler’ option in v3.x.
This commit is contained in:
@@ -430,16 +430,7 @@ namespace Coffee.UIExtensions
|
||||
private Vector3 GetWorldScale()
|
||||
{
|
||||
Profiler.BeginSample("[UIParticleRenderer] GetWorldScale");
|
||||
var scale = _parent.scale3D;
|
||||
//if (_parent.uiScaling)
|
||||
{
|
||||
scale.Scale(_parent.transform.localScale.Inverse());
|
||||
}
|
||||
//else if (_parent.scalingMode == UIParticle.ScalingMode.UI && _particleSystem.main.scalingMode != ParticleSystemScalingMode.Hierarchy)
|
||||
//{
|
||||
// var gscale = _parent.transform.lossyScale.GetScaled(canvas.transform.lossyScale.Inverse());
|
||||
// scale.Scale(gscale * canvas.scaleFactor);
|
||||
//}
|
||||
var scale = _parent.scale3D.GetScaled(_parent.parentScale);
|
||||
Profiler.EndSample();
|
||||
return scale;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user