clicked
Callback triggered when the target element is clicked.
읽는 시간 1분최근 업데이트: 한 달 전
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!"); }}