Skip to content

Commit

Permalink
fix unit UI showing up above promotion chooser etc
Browse files Browse the repository at this point in the history
  • Loading branch information
cryy22 committed Apr 23, 2024
1 parent dc6b516 commit 4deff1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Runtime/Helpers/LocalSpaceConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ public static Vector3 ConvertScale(Transform from, Transform to, Vector3 scale)
return to.InverseTransformVector(from.TransformVector(scale));
}

public static Vector3 LocalScaleForGlobalUnity(Transform transform)
{
return new Vector3(
x: transform.localScale.x / transform.lossyScale.x,
y: transform.localScale.y / transform.lossyScale.y,
z: transform.localScale.z / transform.lossyScale.z
);
}

public static void SetGlobalScale(this Transform transform, Vector3 globalScale)
{
transform.localScale = Vector3.one;
Expand Down

0 comments on commit 4deff1b

Please sign in to comment.