HeavenStudio/Assets/Scripts/Transform/ForceScaleIdentity.cs
2021-12-25 01:22:09 -05:00

15 lines
414 B
C#

using UnityEngine;
public class ForceScaleIdentity : MonoBehaviour
{
public GameObject parent;
void Update()
{
if (parent == null)
transform.localScale = new Vector3(1f / transform.parent.localScale.x, 1f / transform.parent.localScale.y);
else
transform.localScale = new Vector3(1f / parent.transform.localScale.x, 1f / parent.transform.localScale.y);
}
}