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