@ray-js/ipc-player-integration 0.0.1 → 0.0.2
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.
|
@@ -106,8 +106,8 @@ export function useDpState(options) {
|
|
|
106
106
|
dps: sendData,
|
|
107
107
|
pipelines: [0, 1, 2, 3, 4, 5, 6],
|
|
108
108
|
options: {},
|
|
109
|
-
success:
|
|
110
|
-
|
|
109
|
+
success: () => {
|
|
110
|
+
//
|
|
111
111
|
},
|
|
112
112
|
fail: error => {
|
|
113
113
|
console.log('publishDps fail', error);
|
|
@@ -73,7 +73,6 @@ export function FullTravelRouteControl(props) {
|
|
|
73
73
|
value: 0,
|
|
74
74
|
onTouchStart: value => {
|
|
75
75
|
pauseTimeToHideAllComponentFn();
|
|
76
|
-
pauseTimeToHideAllComponentRef.current = false;
|
|
77
76
|
sendDpValueFn(String(value));
|
|
78
77
|
// @ts-ignore
|
|
79
78
|
ty.nativeDisabled(true);
|
|
@@ -86,6 +85,7 @@ export function FullTravelRouteControl(props) {
|
|
|
86
85
|
},
|
|
87
86
|
onTouchEnd: () => {
|
|
88
87
|
event.emit(startTimeToHideAllComponent);
|
|
88
|
+
pauseTimeToHideAllComponentRef.current = false;
|
|
89
89
|
sendDpValueFn('-1');
|
|
90
90
|
// @ts-ignore
|
|
91
91
|
ty.nativeDisabled(false);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
2
|
import "core-js/modules/esnext.iterator.map.js";
|
|
3
|
-
import React, { useCallback, useContext, useEffect, useState, useMemo } from 'react';
|
|
3
|
+
import React, { useCallback, useContext, useEffect, useState, useRef, useMemo } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { MoveInterActiveControlUI } from './moveInteractiveControlUI';
|
|
6
6
|
import { playerTap, showAllComponent } from '../../ui/constant';
|
|
7
7
|
import { useDpState, useSchemaInfo } from '../../hooks';
|
|
8
8
|
import { UIEventContext } from '../../ui/context';
|
|
9
|
+
import { useStore } from '../../ctx/store';
|
|
9
10
|
import './moveInteractiveControl.less';
|
|
10
11
|
const TYPE_CODE = 'ipc_manual_petting';
|
|
11
12
|
const STATE_CODE = 'ipc_manual_petting_state';
|
|
@@ -24,7 +25,8 @@ const iconMap = {
|
|
|
24
25
|
};
|
|
25
26
|
export function MoveInteractiveControl(props) {
|
|
26
27
|
const {
|
|
27
|
-
devId
|
|
28
|
+
devId,
|
|
29
|
+
screenType: screenTypeAtom
|
|
28
30
|
} = props;
|
|
29
31
|
const [state, _, sendDp] = useDpState({
|
|
30
32
|
devId,
|
|
@@ -45,6 +47,18 @@ export function MoveInteractiveControl(props) {
|
|
|
45
47
|
event
|
|
46
48
|
} = useContext(UIEventContext);
|
|
47
49
|
const [hide, setHide] = useState(false);
|
|
50
|
+
const {
|
|
51
|
+
screenType
|
|
52
|
+
} = useStore({
|
|
53
|
+
screenType: screenTypeAtom
|
|
54
|
+
});
|
|
55
|
+
const prevScreenType = useRef(screenType);
|
|
56
|
+
if (prevScreenType.current !== screenType) {
|
|
57
|
+
if (screenType === 'vertical' && !hide) {
|
|
58
|
+
setHide(true);
|
|
59
|
+
}
|
|
60
|
+
prevScreenType.current = screenType;
|
|
61
|
+
}
|
|
48
62
|
const onPlayerTap = useCallback(() => {
|
|
49
63
|
setHide(true);
|
|
50
64
|
event.emit(showAllComponent);
|