format
typescript
RectTransform.nameclass: RectTransform
description
(Read-only) The name of the control that the RectTransform is attached to.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
string | The name of the control. |
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.name;