반응형
- 코드 작성
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class ButtonClickAnimation : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public void OnPointerDown(PointerEventData eventData) //버튼 눌렀을 떄
{
transform.localScale = Vector3.one * 0.95f;
}
public void OnPointerUp(PointerEventData eventData) //버튼을 땟을 때
{
transform.localScale = Vector3.one;
}
}
반응형