Skip to content

format

typescript
Control.GetChildByIndex(index)

class: Control

description

Get the child control of the current control based on the index (index starts from 0).

parameter

param_nametypedescription
indexnumberThe index value.

reture

typedescription
ControlThe child control.

code example

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