format
typescript
UIComponent.guiPrefabclass: UIComponent
description
The UI component requires UI resources to render.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
GUIPrefab | UI prefab |
code example
typescript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
// Set UI resources
uiComponent.guiPrefab = Resources.Load<GUIPrefab>(GUIPrefab, "<UUID>");//<UUID>- is the UUID of the UI file
// Remove
uiComponent.guiPrefab = null;