Skip to content

格式

typescript
UIComponent.eventCamera

所属类: UIComponent

描述

处理UI事件的相机。

UI事件,比如鼠标点击、触摸等,需要与一个相机进行交互。该属性就是用来指定处理这些事件的相机的。

参数

参数名类型描述

返回值

类型描述
Camera

代码示例

typescript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
uiComponent.guiPrefab = Resources.Load<GUIPrefab>(GUIPrefab, "<UUID>");//<UUID>-为ui文件的uuid

uiComponent.eventCamera;