@gamelearn/arcade-components 1.22.13 → 1.22.16

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.
@@ -64,7 +64,8 @@ var AnimationComponent = function AnimationComponent(_ref) {
64
64
  type: 'saveAnimation',
65
65
  payload: {
66
66
  uid: resource.uid,
67
- animation: animation.id
67
+ animation: animation.id,
68
+ index: object.index
68
69
  }
69
70
  });
70
71
  emitEvent({
@@ -466,48 +466,52 @@ var DialogComponent = function DialogComponent(_ref) {
466
466
  (0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
467
467
  }
468
468
 
469
- if (talkingCharacter.uid === element.uid) {
470
- var showArrowTop = talkingCharacter.text.length > maxCharacterToSwitch;
471
- var head = element.getObjectByName('Head_M');
472
- var target = new _three.Object3D();
473
- head.getWorldPosition(target.position);
474
- target.applyQuaternion(camera.quaternion);
475
- var distance = camera.position.distanceTo(target.position);
476
- var staticDisplay = distance > 70 && !zoomInActor && !showArrowTop;
477
- target.translateY(staticDisplay || showArrowTop ? 0 : 3); // Detectar posicion de personaje a izq o derecha de pantalla
478
-
479
- var vector = new _three.Vector3();
480
- vector.setFromMatrixPosition(head.matrixWorld);
481
- var p = vector.project(defaultCamera);
482
- var isLeft = p.x < 0;
483
- messagePosition.current = {
484
- pos: target.position.toArray(),
485
- child: head,
486
- parent: element,
487
- isLeft: isLeft
488
- };
489
-
490
- if (zoomInActor) {
491
- setAnimationRunning(true);
492
- } // Ugly timeout to wait for zoom in ( maybe use tween (?))
493
-
494
-
495
- setTimeout(function () {
496
- var _talkingCharacter$cha;
497
-
498
- distance = camera.position.distanceTo(target.position);
499
- setCurrentMessage({
500
- text: talkingCharacter.text,
501
- name: talkingCharacter.alias || ((_talkingCharacter$cha = talkingCharacter.character) === null || _talkingCharacter$cha === void 0 ? void 0 : _talkingCharacter$cha.name),
502
- left: true,
503
- top: showArrowTop || distance > 70,
504
- inScene: true,
505
- thinkful: talkingCharacter.emotion === 'thinkful',
506
- avatar: '',
507
- show: true
508
- });
509
- }, zoomInActor ? 1000 : 0);
510
- }
469
+ setTimeout(function () {
470
+ if (talkingCharacter.uid === element.uid) {
471
+ var showArrowTop = talkingCharacter.text.length > maxCharacterToSwitch;
472
+ var head = element.getObjectByName('Head_M');
473
+ var target = new _three.Object3D();
474
+ head.updateMatrix();
475
+ head.updateMatrixWorld();
476
+ head.getWorldPosition(target.position);
477
+ target.applyQuaternion(camera.quaternion);
478
+ var distance = camera.position.distanceTo(target.position);
479
+ var staticDisplay = distance > 70 && !zoomInActor && !showArrowTop;
480
+ target.translateY(staticDisplay || showArrowTop ? 0 : 3); // Detectar posicion de personaje a izq o derecha de pantalla
481
+
482
+ var vector = new _three.Vector3();
483
+ vector.setFromMatrixPosition(head.matrixWorld);
484
+ var p = vector.project(defaultCamera);
485
+ var isLeft = p.x < 0;
486
+ messagePosition.current = {
487
+ pos: target.position.toArray(),
488
+ child: head,
489
+ parent: element,
490
+ isLeft: isLeft
491
+ };
492
+
493
+ if (zoomInActor) {
494
+ setAnimationRunning(true);
495
+ } // Ugly timeout to wait for zoom in ( maybe use tween (?))
496
+
497
+
498
+ setTimeout(function () {
499
+ var _talkingCharacter$cha;
500
+
501
+ distance = camera.position.distanceTo(target.position);
502
+ setCurrentMessage({
503
+ text: talkingCharacter.text,
504
+ name: talkingCharacter.alias || ((_talkingCharacter$cha = talkingCharacter.character) === null || _talkingCharacter$cha === void 0 ? void 0 : _talkingCharacter$cha.name),
505
+ left: true,
506
+ top: showArrowTop || distance > 70,
507
+ inScene: true,
508
+ thinkful: talkingCharacter.emotion === 'thinkful',
509
+ avatar: '',
510
+ show: true
511
+ });
512
+ }, zoomInActor ? 1200 : 0);
513
+ }
514
+ }, crossFadeDuration * 100);
511
515
  });
512
516
  } else {
513
517
  var _talkingCharacter$cha2;
@@ -630,9 +634,9 @@ var DialogComponent = function DialogComponent(_ref) {
630
634
  }
631
635
 
632
636
  var mult = messagePosition.current.isLeft ? -1 : 1;
633
- var headSpace = 2.25 * mult; // move bubble
637
+ var headSpace = 2 * mult; // move bubble
634
638
 
635
- messagePosition.current.pos[0] -= 1.25;
639
+ messagePosition.current.pos[0] -= headSpace;
636
640
  animationTarget.current.translateX(-10 * mult - headSpace);
637
641
  animationTarget.current.translateY(-5);
638
642
  animationTarget.current.translateZ(30);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "1.22.13",
5
+ "version": "1.22.16",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",