Mode
模式模块主要做编辑模式的管理
mode.enterPlayMode(进入预览模式)输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
defaultPageId | string | 是 | — | 默认加载的页面ID |
调用
typescript
piclient.emit("mode.enterPlayMode",{
defaultPageId: "", //默认加载的页面ID
})
mode.event(通用的事件触发,从外部通知PiClient事件的发生)输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
action | string | 是 | — | — |
target | string | 是 | ObjectId | — |
params | string | 是 | — | — |
调用
typescript
piclient.emit("mode.event",{
action: "",
target: "ObjectId",
params: "",
})
mode.enableTransparency(是否让设计器的UI可以穿透交互)输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
enable | boolean | 是 | true | — |
调用
typescript
piclient.emit("mode.enableTransparency",{
enable: true,
})
scene.moveCameraByOffset(在相机平面偏移相机)输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
offsetX | number | 是 | 0.0 | — |
offsetY | number | 是 | 0.0 | — |
调用
typescript
piclient.emit("scene.moveCameraByOffset",{
offsetX: 0.0,
offsetY: 0.0,
})