clicked
Callback triggered when the target element is clicked.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Event
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
public event Action clicked
Remarks
Encapsulates a method that has no parameters and does not return a value.
Examples
using UnityEngine;using UnityEditor;using UnityEngine.UIElements;public class ButtonExample : EditorWindow{ [MenuItem("Window/Button Example")] public static void ShowExample() { GetWindow<ButtonExample>(); } void CreateGUI() { var button = new Button { text = "Click me" }; button.clicked += OnClick; rootVisualElement.Add(button); } void OnClick() { Debug.Log("Clicked!"); }}