public void OnPointerUp(PointerEventData eventData) { isPointDown = false; if (OnRelease != null) { OnRelease.Invoke(); } UIButtonScale sc = gameObject.GetComponent <UIButtonScale>(); if (sc != null) { sc.OnPress(false); } }
public void OnPointerDown(PointerEventData eventData) { if (OnPress != null) { OnPress.Invoke(); } UIButtonScale sc = gameObject.GetComponent <UIButtonScale>(); if (sc != null) { sc.OnPress(true); } isPointDown = true; lastInvokeTime = Time.time; }
public void OnPointerDown(PointerEventData eventData) { if (polygonCollider != null && UICamera.currentCamera != null) { if (polygonCollider.OverlapPoint(UICamera.currentCamera.ScreenToWorldPoint(eventData.position))) { if (OnPress != null) { if (ChangeColor) { Img.color = hilight; } OnPress.Invoke(); } UIButtonScale sc = gameObject.GetComponent <UIButtonScale>(); if (sc != null) { sc.OnPress(true); } isPointDown = true; lastInvokeTime = Time.time; pointDownFrame = Time.frameCount; } } else { if (OnPress != null) { if (ChangeColor) { Img.color = hilight; } OnPress.Invoke(); } UIButtonScale sc = gameObject.GetComponent <UIButtonScale>(); if (sc != null) { sc.OnPress(true); } isPointDown = true; lastInvokeTime = Time.time; pointDownFrame = Time.frameCount; } }
public void OnPointerUp(PointerEventData eventData) { if (isPointDown) { isPointDown = false; if (OnRelease != null) { if (ChangeColor) { Img.color = normal; } OnRelease.Invoke(); } UIButtonScale sc = gameObject.GetComponent <UIButtonScale>(); if (sc != null) { sc.OnPress(false); } } }