Skip to content

format

typescript
Control.childCount

class: Control

description

Get the number of child controls of the current control.

parameter

param_nametypedescription

reture

typedescription
numberThe number of child controls.

code example

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