- Home /
Scaling UI With Lean Tween
Hi I'm trying to animate a panel to fill a certain area, however when I scale it, it only works with one resolution.How do I scale the panel to fit all resolutions?
Here is my code
float targetX = 18.1f;
float targetY = 26.0f;
private void OnEnable()
{
Vector3 scaleTarget = new Vector3(targetX, targetY, gameObject.GetComponent<RectTransform>().localScale.z);
LeanTween.scale(gameObject.GetComponent<RectTransform>(), scaleTarget, 1.0f);
LeanTween.moveY(gameObject.GetComponent<RectTransform>(), 10, 1.001f);
}
Comment