Clickable.clicked

Description

Callback triggered when the target element is clicked.

The clicked and clickedWithEventInfo events are invoked when any of the following conditions occur:

If the delay and interval optional constructor parameters are used, then the clicked event is considered repeatable and is instead invoked when any of the following conditions occur:

If the clicked event is repeatable, then the first repeated click occurs after an amount of time corresponding to the delay parameter, and subsequent clicks occur after amounts of time corresponding to the interval parameter.

The callback methods registered to this event should have no parameters and return no value.

This manipulator makes use of pointer capture.

Additional resources: Clickable.clickedWithEventInfo, NavigationSubmitEvent, PointerDownEvent, PointerCaptureEvent

 public VisualElement CreateButton()
 {
     var button = new Button { text = "Press Me" };
     button.clicked += () =>
     {
         Debug.Log("Button was pressed!");
     };
     return button;
 }

Did you find this page useful? Please give it a rating: