@gamelearn/arcade-components 2.18.1 → 2.18.3

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.
@@ -48,7 +48,7 @@ var AnimationComponent = function AnimationComponent(_ref) {
48
48
  }, []);
49
49
  (0, _react.useEffect)(function () {
50
50
  setMounted(false);
51
- }, [resource.uid, animation.url]);
51
+ }, [resource.uid, animation === null || animation === void 0 ? void 0 : animation.url]);
52
52
  (0, _react.useEffect)(function () {
53
53
  if (!mounted) {
54
54
  var object;
@@ -58,7 +58,7 @@ var AnimationComponent = function AnimationComponent(_ref) {
58
58
  }
59
59
  });
60
60
 
61
- if (object) {
61
+ if (object && animation) {
62
62
  if (makeDefault) {
63
63
  emitEvent({
64
64
  type: 'saveAnimation',
@@ -103,7 +103,7 @@ var AnimationComponent = function AnimationComponent(_ref) {
103
103
  });
104
104
  }
105
105
  }
106
- }, [scene, animation.url, loopTimes, emitEvent, mounted, loader, resource.uid, makeDefault, animation, resource, enableInteraction]);
106
+ }, [scene, animation === null || animation === void 0 ? void 0 : animation.url, loopTimes, emitEvent, mounted, loader, resource.uid, makeDefault, animation, resource, enableInteraction]);
107
107
  return null;
108
108
  };
109
109
 
@@ -353,11 +353,17 @@ var DialogComponent = function DialogComponent(_ref) {
353
353
  });
354
354
  }
355
355
 
356
- if (lastSet.current || !messagePosition.current.child) {
357
- cam.copy(defaultCamera);
356
+ zoomStarted.current = false;
357
+
358
+ if (lastSet.current) {
359
+ emitEvent({
360
+ type: 'success'
361
+ });
358
362
  }
359
363
 
360
- zoomStarted.current = false;
364
+ if (!messagePosition.current.child) {
365
+ cam.copy(defaultCamera);
366
+ }
361
367
  }
362
368
  }, animationTarget.position));
363
369
  } else if (zoomStarted.current) {
@@ -431,12 +437,14 @@ var DialogComponent = function DialogComponent(_ref) {
431
437
  show: false
432
438
  });
433
439
  resetCameraView();
434
- camera.copy(defaultCamera);
435
440
  resetAnims();
436
- emitEvent({
437
- type: 'success'
438
- });
439
- }, [camera, emitEvent, resetAnims, resetCameraView]); // Reset anim after unmount
441
+
442
+ if (!zoomInActor) {
443
+ emitEvent({
444
+ type: 'success'
445
+ });
446
+ }
447
+ }, [camera, emitEvent, resetAnims, resetCameraView, zoomInActor]); // Reset anim after unmount
440
448
 
441
449
  (0, _react.useEffect)(function () {
442
450
  return function () {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "2.18.1",
5
+ "version": "2.18.3",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",