using UnityEngine;
|
using UnityEngine.EventSystems;
|
|
public class ChangeBtnScale : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
{
|
RectTransform rect;
|
Vector3 startScale;
|
|
public void OnPointerDown(PointerEventData eventData)
|
{
|
rect.localScale = startScale * 0.9f;
|
}
|
|
public void OnPointerUp(PointerEventData eventData)
|
{
|
rect.localScale = startScale;
|
}
|
|
// Start is called before the first frame update
|
private void Awake()
|
{
|
rect = GetComponent<RectTransform>();
|
startScale = rect.localScale;
|
}
|
|
|
|
}
|