格式
typescript
Control.Clone(parent)所属类: Control
描述
克隆当前控件。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| parent | Control? |
返回值
| 类型 | 描述 |
|---|---|
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();