wangguan
2020-10-30 85a8bf40b30bbe57dc2220be79a885487e46c190
Assets/Scripts/UI/ChangeBtnScale.cs
@@ -4,22 +4,23 @@
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;
    }