Skip to content

格式

typescript
Control.Disable()

所属类: Control

描述

禁用控件。

被禁用的控件无法响应相关的交互事件。

参数

参数名类型描述

返回值

类型描述
void

代码示例

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