Skip to content

format

typescript
Control.Close()

class: Control

description

Close the current control.

Equivalent to calling the setParent method and setting the parent object to nil.

parameter

param_nametypedescription

reture

typedescription
void

code example

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