Skip to content

格式

typescript
Control.GetChildByIndex(index)

所属类: Control

描述

根据索引获取当前控件的子控件(索引从0开始)。

参数

参数名类型描述
indexnumberi索引值

返回值

类型描述
Control子控件

代码示例

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