Skip to content

Commit

Permalink
refactor: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Nov 15, 2020
1 parent 08273cb commit fc4bd70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Scripts/Editor/UIParticleEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ protected override void OnEnable()
{
EditorGUI.LabelField(new Rect(rect.x, rect.y, 150, rect.height), s_ContentRenderingOrder);
#if UNITY_2019_3_OR_NEWER
#if UNITY_2019_3_OR_NEWER
rect = new Rect(rect.width - 55, rect.y, 80, rect.height);
#else
#else
rect = new Rect(rect.width - 55, rect.y - 1, 80, rect.height);
#endif
#endif
if (GUI.Button(rect, s_ContentRefresh, EditorStyles.miniButton))
{
Expand Down
3 changes: 1 addition & 2 deletions Scripts/UIParticle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public class UIParticle : MaskableGraphic
private List<ParticleSystem> m_Particles = new List<ParticleSystem>();

#if !SERIALIZE_FIELD_MASKABLE
[SerializeField]
private bool m_Maskable = true;
[SerializeField] private bool m_Maskable = true;
#endif

private bool _shouldBeRemoved;
Expand Down
6 changes: 3 additions & 3 deletions Scripts/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ public static void SortForRendering(this List<ParticleSystem> self, Transform tr
// Z position & sortingFudge: descending
var aTransform = a.transform;
var bTransform = b.transform;
var aPos = tr.InverseTransformPoint(aTransform.position).z+ aRenderer.sortingFudge;
var bPos = tr.InverseTransformPoint(bTransform.position).z+ bRenderer.sortingFudge;
var aPos = tr.InverseTransformPoint(aTransform.position).z + aRenderer.sortingFudge;
var bPos = tr.InverseTransformPoint(bTransform.position).z + bRenderer.sortingFudge;
if (!Mathf.Approximately(aPos, bPos))
return (int)Mathf.Sign(bPos - aPos);
return (int) Mathf.Sign(bPos - aPos);
// Material instance ID: match
if (aMat.GetInstanceID() == bMat.GetInstanceID())
Expand Down

0 comments on commit fc4bd70

Please sign in to comment.