Пример #1
0
    void OnMouseUp()
    {
        tween.Complete();
        lastPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        //Debug.LogFormat("onMouseUp != null");
        onMouseUp?.Invoke(firstPosition, lastPosition);
    }
Пример #2
0
        private void OnMouseUp()
        {
            PointerEventData ped = new PointerEventData(EventSystem.current);

            ped.position = Input.mousePosition;

            bool      brelatedUIHit = false;
            Transform transform;

            GameObject raycastHitGameObject = ((CustomStandaloneInputModule)EventSystem.current.currentInputModule)
                                              .PointerEventDataLeft().pointerEnter;


            if (raycastHitGameObject != null)
            {
                for (int i = 0; i < _relatedUIPanels.Count; i++)
                {
                    GameObject g = _relatedUIPanels[i];

                    if (raycastHitGameObject == g)
                    {
                        brelatedUIHit = true;
                    }
                    else
                    {
                        transform = raycastHitGameObject.transform.parent;
                        int count = 0;
                        while (transform != null && count < 1000)
                        {
                            count++;

                            if (transform.gameObject == g)
                            {
                                brelatedUIHit = true;
                                break;
                            }
                            else
                            {
                                transform = transform.parent;
                            }
                        }
                    }
                }
            }

            if (!brelatedUIHit && raycastHitGameObject != null)
            {
                return;
            }

            if (OnMouseUpEvent != null)
            {
                OnMouseUpEvent.Invoke();
            }
        }
Пример #3
0
 public void OnMouseUp()
 {
     OnMouseUpEvent.Invoke();
 }
Пример #4
0
 void OnMouseUp()
 {
     onTrigger.Invoke(gameObject);
 }