Skip to content

Button

extends TransitionControl

Inherits from Control

The Button class is used to implement click interactions.

You can obtain a Button control in the following way:

typeScript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
let canvas = uiComponent.canvas;		
let button = canvas.FindChild<Button>("Button");

成员变量

Button.text : string
The text content on the button.