using UnityEngine;
public class Test : MonoBehaviour
{
void OnHover (bool isOver)
{
UIRect rect = GetComponent<UIRect>();
if (isOver)
{
rect.leftAnchor.absolute -= 50;
rect.rightAnchor.absolute += 50;
}
else
{
rect.leftAnchor.absolute += 50;
rect.rightAnchor.absolute -= 50;
}
rect.ResetAnchors();
rect.UpdateAnchors();
}
}