format
typescript
RectTransform.controlclass: RectTransform
description
(Read-only) The control object that the RectTransform is attached to.
Every RectTransform component is always attached to a control object.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Control | The control object. |
code example
typeScript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
let canvas = uiComponent.canvas;
let button = canvas.FindChild("Button");
let rectTransform = button.rectTransform;
rectTransform.control;