Esempio n. 1
0
    public void OnPointerUp(PointerEventData eventData)
    {
        isPointDown = false;
        if (OnRelease != null)
        {
            OnRelease.Invoke();
        }
        UIButtonScale sc = gameObject.GetComponent <UIButtonScale>();

        if (sc != null)
        {
            sc.OnPress(false);
        }
    }
Esempio n. 2
0
    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;
    }
Esempio n. 3
0
 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;
     }
 }
Esempio n. 4
0
 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);
         }
     }
 }