Skip to content

Commit

Permalink
fix: particle size too small due to auto scaling
Browse files Browse the repository at this point in the history
close #295
  • Loading branch information
mob-sakai committed Apr 4, 2024
1 parent f73a677 commit 990baac
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions Runtime/UIParticle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ public enum PositionMode
"UIParticle: UIParticle.scale will be adjusted.")]
private AutoScalingMode m_AutoScalingMode = AutoScalingMode.Transform;

[SerializeField]
private bool m_ResetScaleOnEnable;

private readonly List<UIParticleRenderer> _renderers = new List<UIParticleRenderer>();
private int _groupId;
private Camera _orthoCamera;
Expand Down Expand Up @@ -297,13 +294,6 @@ protected override void OnEnable()
}

base.OnEnable();

// Reset scale for upgrade.
if (m_ResetScaleOnEnable)
{
m_ResetScaleOnEnable = false;
transform.localScale = Vector3.one;
}
}

/// <summary>
Expand Down Expand Up @@ -345,17 +335,6 @@ void ISerializationCallbackReceiver.OnAfterDeserialize()
m_IgnoreCanvasScaler = false;
m_AutoScaling = false;
m_AutoScalingMode = AutoScalingMode.Transform;
m_ResetScaleOnEnable = true;

#if UNITY_EDITOR
EditorApplication.delayCall += () =>
{
if (!this || !gameObject || !transform || Application.isPlaying) return;
transform.localScale = Vector3.one;
m_ResetScaleOnEnable = false;
EditorUtility.SetDirty(this);
};
#endif
}

if (m_AbsoluteMode)
Expand Down

0 comments on commit 990baac

Please sign in to comment.