format
typescript
UIComponent.canvasclass: UIComponent
description
Read-only. The current canvas of the UI component.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Canvas | The canvas. |
code example
typescript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
uiComponent.guiPrefab = Resources.Load<GUIPrefab>(GUIPrefab, "<UUID>");//<UUID>- is the UUID of the UI file
let canvas = uiComponent.canvas;