Skip to content

format

typescript
UIComponent.guiPrefab

class: UIComponent

description

The UI component requires UI resources to render.

parameter

param_nametypedescription

reture

typedescription
GUIPrefabUI 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;