@dcl/ecs 7.0.6-4195929129.commit-862da77 → 7.0.6-4196319965.commit-5ba2a36
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/dist/engine/input.d.ts +1 -1
- package/dist/engine/input.js +14 -1
- package/package.json +3 -3
package/dist/engine/input.d.ts
CHANGED
|
@@ -30,5 +30,5 @@ export type IInputSystem = {
|
|
|
30
30
|
* @param entity - the entity to query, ignore for global
|
|
31
31
|
* @returns the input command info or undefined if there is no command in the last tick-update
|
|
32
32
|
*/
|
|
33
|
-
getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity
|
|
33
|
+
getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => PBPointerEventsResult | null;
|
|
34
34
|
};
|
package/dist/engine/input.js
CHANGED
|
@@ -123,7 +123,7 @@ export function createInputSystem(engine) {
|
|
|
123
123
|
}
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function getInputCommandFromEntity(inputAction, pointerEventType, entity) {
|
|
127
127
|
if (inputAction !== 3 /* InputAction.IA_ANY */) {
|
|
128
128
|
return findInputCommand(inputAction, pointerEventType, entity);
|
|
129
129
|
}
|
|
@@ -134,6 +134,19 @@ export function createInputSystem(engine) {
|
|
|
134
134
|
}
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
|
+
function getInputCommand(inputAction, pointerEventType, entity) {
|
|
138
|
+
if (entity) {
|
|
139
|
+
return getInputCommandFromEntity(inputAction, pointerEventType, entity);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
for (const command of globalState.thisFrameCommands) {
|
|
143
|
+
if (command.button === inputAction && command.state === pointerEventType) {
|
|
144
|
+
return command;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
137
150
|
function findInputCommand(inputAction, pointerEventType, entity) {
|
|
138
151
|
// We search the last pointer Event command sorted by timestamp
|
|
139
152
|
const command = findLastAction(pointerEventType, inputAction, entity);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/ecs",
|
|
3
|
-
"version": "7.0.6-
|
|
3
|
+
"version": "7.0.6-4196319965.commit-5ba2a36",
|
|
4
4
|
"description": "Decentraland ECS",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ts-proto": "^1.112.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@dcl/js-runtime": "7.0.6-
|
|
30
|
+
"@dcl/js-runtime": "7.0.6-4196319965.commit-5ba2a36",
|
|
31
31
|
"@dcl/protocol": "1.0.0-4177500465.commit-247c87f"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"displayName": "ECS",
|
|
41
41
|
"tsconfig": "./tsconfig.json"
|
|
42
42
|
},
|
|
43
|
-
"commit": "
|
|
43
|
+
"commit": "5ba2a3616ea419a04974be07876850ed63eca7e2"
|
|
44
44
|
}
|