Skip to content

格式

typescript
Control.Clone(parent)

所属类: Control

描述

克隆当前控件。

参数

参数名类型描述
parentControl?

返回值

类型描述
Control克隆体

代码示例

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