@gamelearn/arcade-components 1.21.2 → 1.21.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.
@@ -59,41 +59,43 @@ var AnimationComponent = function AnimationComponent(_ref) {
59
59
  });
60
60
 
61
61
  if (object) {
62
- var canInteract = enableInteraction;
63
- if (canInteract) emitEvent({
64
- type: 'success'
65
- });
66
- loader.load(animation.url, function (gltf) {
67
- var mixer = object.userData.mixer;
68
- var defaultAnim = object.userData.defaultAnim;
69
- var currentAction = mixer.clipAction(gltf.animations[0], object);
70
- var oldAction = mixer.clipAction(defaultAnim, object);
71
- currentAction.setLoop(_three.LoopRepeat, loopTimes);
72
- mixer.stopAllAction();
73
- (0, _helpers.executeCrossFade)(oldAction, currentAction, 0.5);
74
-
75
- var finishCallback = function finishCallback() {
76
- (0, _helpers.executeCrossFade)(currentAction, oldAction, 0.5);
77
-
78
- if (makeDefault) {
79
- emitEvent({
80
- type: 'saveAnimation',
81
- payload: {
82
- uid: resource.uid,
83
- animation: animation.id
84
- }
85
- });
62
+ if (makeDefault) {
63
+ emitEvent({
64
+ type: 'saveAnimation',
65
+ payload: {
66
+ uid: resource.uid,
67
+ animation: animation.id
86
68
  }
69
+ });
70
+ emitEvent({
71
+ type: 'success'
72
+ });
73
+ } else {
74
+ var canInteract = enableInteraction;
75
+ if (canInteract) emitEvent({
76
+ type: 'success'
77
+ });
78
+ loader.load(animation.url, function (gltf) {
79
+ var mixer = object.userData.mixer;
80
+ var defaultAnim = object.userData.defaultAnim;
81
+ var currentAction = mixer.clipAction(gltf.animations[0], object);
82
+ var oldAction = mixer.clipAction(defaultAnim, object);
83
+ currentAction.setLoop(_three.LoopRepeat, loopTimes);
84
+ mixer.stopAllAction();
85
+ (0, _helpers.executeCrossFade)(oldAction, currentAction, 0.5);
86
+
87
+ var finishCallback = function finishCallback() {
88
+ (0, _helpers.executeCrossFade)(currentAction, oldAction, 0.5);
89
+ if (!canInteract) emitEvent({
90
+ type: 'success'
91
+ });
92
+ mixer.removeEventListener('finished', finishCallback);
93
+ };
87
94
 
88
- if (!canInteract) emitEvent({
89
- type: 'success'
90
- });
91
- mixer.removeEventListener('finished', finishCallback);
92
- };
93
-
94
- mixer.addEventListener('finished', finishCallback);
95
- setMounted(true);
96
- });
95
+ mixer.addEventListener('finished', finishCallback);
96
+ setMounted(true);
97
+ });
98
+ }
97
99
  } else {
98
100
  emitEvent({
99
101
  type: 'success'
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.21.2",
5
+ "version": "1.21.3",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",