@dcl/playground-assets 7.0.6-4195735563.commit-275390b → 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/alpha.d.ts CHANGED
@@ -1778,7 +1778,7 @@ export declare type IInputSystem = {
1778
1778
  * @param entity - the entity to query, ignore for global
1779
1779
  * @returns the input command info or undefined if there is no command in the last tick-update
1780
1780
  */
1781
- getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity: Entity) => PBPointerEventsResult | null;
1781
+ getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => PBPointerEventsResult | null;
1782
1782
  };
1783
1783
 
1784
1784
  /**
package/dist/beta.d.ts CHANGED
@@ -1774,7 +1774,7 @@ export declare type IInputSystem = {
1774
1774
  * @param entity - the entity to query, ignore for global
1775
1775
  * @returns the input command info or undefined if there is no command in the last tick-update
1776
1776
  */
1777
- getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity: Entity) => PBPointerEventsResult | null;
1777
+ getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => PBPointerEventsResult | null;
1778
1778
  };
1779
1779
 
1780
1780
  /**
@@ -1774,7 +1774,7 @@ export declare type IInputSystem = {
1774
1774
  * @param entity - the entity to query, ignore for global
1775
1775
  * @returns the input command info or undefined if there is no command in the last tick-update
1776
1776
  */
1777
- getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity: Entity) => PBPointerEventsResult | null;
1777
+ getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => PBPointerEventsResult | null;
1778
1778
  };
1779
1779
 
1780
1780
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function (exports, communicationsController, EthereumController, EngineApi) {
1
+ (function (exports, EngineApi, communicationsController, EthereumController) {
2
2
  'use strict';
3
3
 
4
4
  function _interopNamespaceDefault(e) {
@@ -15539,7 +15539,7 @@
15539
15539
  }
15540
15540
  return null;
15541
15541
  }
15542
- function getInputCommand(inputAction, pointerEventType, entity) {
15542
+ function getInputCommandFromEntity(inputAction, pointerEventType, entity) {
15543
15543
  if (inputAction !== 3 /* InputAction.IA_ANY */) {
15544
15544
  return findInputCommand(inputAction, pointerEventType, entity);
15545
15545
  }
@@ -15550,6 +15550,19 @@
15550
15550
  }
15551
15551
  return null;
15552
15552
  }
15553
+ function getInputCommand(inputAction, pointerEventType, entity) {
15554
+ if (entity) {
15555
+ return getInputCommandFromEntity(inputAction, pointerEventType, entity);
15556
+ }
15557
+ else {
15558
+ for (const command of globalState.thisFrameCommands) {
15559
+ if (command.button === inputAction && command.state === pointerEventType) {
15560
+ return command;
15561
+ }
15562
+ }
15563
+ return null;
15564
+ }
15565
+ }
15553
15566
  function findInputCommand(inputAction, pointerEventType, entity) {
15554
15567
  // We search the last pointer Event command sorted by timestamp
15555
15568
  const command = findLastAction(pointerEventType, inputAction, entity);
@@ -42538,7 +42551,7 @@
42538
42551
  }
42539
42552
  }
42540
42553
 
42541
- let subscribeFunction = async () => ({});
42554
+ let subscribeFunction = EngineApi.subscribe;
42542
42555
  function createSubscriber(eventName) {
42543
42556
  return () => {
42544
42557
  subscribeFunction({ eventId: eventName }).catch(console.error);
@@ -42607,6 +42620,10 @@
42607
42620
  onPlayerClickedObservable.notifyObservers(data);
42608
42621
  break;
42609
42622
  }
42623
+ case 'comms': {
42624
+ onCommsMessage.notifyObservers(data);
42625
+ break;
42626
+ }
42610
42627
  }
42611
42628
  }
42612
42629
  }
@@ -42632,10 +42649,6 @@
42632
42649
  emit(message, payload) {
42633
42650
  const messageToSend = JSON.stringify({ message, payload });
42634
42651
  this.sendRaw(messageToSend);
42635
- onCommsMessage.notifyObservers({
42636
- message: messageToSend,
42637
- sender: 'self'
42638
- });
42639
42652
  }
42640
42653
  flush() {
42641
42654
  if (this.messageQueue.length === 0)
@@ -42720,7 +42733,6 @@
42720
42733
 
42721
42734
  const rendererTransport = createRendererTransport({ crdtSendToRenderer: EngineApi.crdtSendToRenderer });
42722
42735
  engine.addTransport(rendererTransport);
42723
- setSubscribeFunction(EngineApi.subscribe);
42724
42736
  async function onUpdate(deltaTime) {
42725
42737
  await engine.update(deltaTime);
42726
42738
  await pollEvents(EngineApi.sendBatch);
@@ -42869,4 +42881,4 @@
42869
42881
  exports.pollEvents = pollEvents;
42870
42882
  exports.setSubscribeFunction = setSubscribeFunction;
42871
42883
 
42872
- })(this.globalThis = this.globalThis || {}, communicationsController, EthereumController, EngineApi);
42884
+ })(this.globalThis = this.globalThis || {}, EngineApi, communicationsController, EthereumController);