示例#1
0
 public void OnMouseDoubleClickHandler(MouseButtonEventData eventData)
 {
     if (eventData.Button == ButtonKey.Left)
     {
         Debug.Log("left double click!");
     }
 }
示例#2
0
    public void OnMouseClickHandler(MouseButtonEventData eventData)
    {

        if (eventData.Button == ButtonKey.Left)
        {
            Debug.Log("left click!");
        }
        else if (eventData.Button == ButtonKey.Middle)
        {
            Debug.Log("middle click!");
        }
        else if (eventData.Button == ButtonKey.Right)
        {
            Debug.Log("right click!");
        }

        //if (eventData.LeftButtonState == MouseButtonState.Pressed)
        //{
        //    Debug.Log( "left click!");
        //}

        //else if (eventData.MiddleButtonState == MouseButtonState.Pressed)
        //{
        //    Debug.Log("middle click!");
        //}

        //else if (eventData.RightButtonState == MouseButtonState.Pressed)
        //{
        //    Debug.Log("right click!");
        //}

        eventData.MarkUse(this, true);
    }
示例#3
0
        internal virtual void OnMouseUp(MouseButtonEventData eventData)
        {
            if (BreakPass(eventData))
                return;

            ExecuteEvents.Execute(this, eventData, ExecuteEvents.MouseUpHandler);

            Parent.OnMouseUp(eventData);
        }