format
typescript
UIComponent.uiModeclass: UIComponent
description
UI mode CanvasMode
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
CanvasMode | UI mode |
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
//Default mode
uiComponent.uiMode = CanvasMode.Screen;
//Scene UI
uiComponent.uiMode = CanvasMode.Scene;