model-action 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/Scene.ts +35 -0
package/package.json
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
/**
|
5
|
+
* 场景方法
|
6
|
+
*/
|
7
|
+
import { Action, SendParam } from "./Action";
|
8
|
+
|
9
|
+
|
10
|
+
enum SceneActionType{
|
11
|
+
Exit = '0', //退出独显
|
12
|
+
Enter = '1', //进入独显
|
13
|
+
}
|
14
|
+
type SceneType = {
|
15
|
+
action: SceneActionType,
|
16
|
+
isAdjustLight: boolean //是否调整灯光
|
17
|
+
tag?: string, //指定场景需要打的tag,根据项目定义,如果场景中只有一处需要独显,这里可以不传该字段
|
18
|
+
} & SendParam
|
19
|
+
|
20
|
+
export class SceneAction extends Action {
|
21
|
+
/**
|
22
|
+
* 独显某场景模型
|
23
|
+
* @param {*} action 自定义轨迹ID
|
24
|
+
*/
|
25
|
+
static show(action:SceneActionType,isAdjustLight:SceneType['isAdjustLight'] = false,tag:SceneType['tag']) {
|
26
|
+
const param: SceneType = {
|
27
|
+
cmd: "POI",
|
28
|
+
action,
|
29
|
+
tag,
|
30
|
+
isAdjustLight
|
31
|
+
};
|
32
|
+
this.sendParam(param, `${action==='0'?'退出':'进入'}独显`);
|
33
|
+
}
|
34
|
+
|
35
|
+
}
|