@eva/plugin-transition 2.0.0-beta.0 → 2.0.0-beta.2
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/EVA.plugin.transition.js +113 -191
- package/dist/EVA.plugin.transition.min.js +1 -1
- package/dist/plugin-transition.cjs.js +100 -169
- package/dist/plugin-transition.cjs.prod.js +1 -1
- package/dist/{packages/plugin-transition/lib/component.d.ts → plugin-transition.d.ts} +16 -7
- package/dist/plugin-transition.esm.js +100 -169
- package/package.json +2 -2
- package/dist/packages/eva.js/lib/core/Component.d.ts +0 -35
- package/dist/packages/eva.js/lib/core/Component.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/core/ComponentObserver.d.ts +0 -22
- package/dist/packages/eva.js/lib/core/ComponentObserver.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/core/GameObject.d.ts +0 -31
- package/dist/packages/eva.js/lib/core/GameObject.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/core/System.d.ts +0 -30
- package/dist/packages/eva.js/lib/core/System.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/core/Transform.d.ts +0 -51
- package/dist/packages/eva.js/lib/core/Transform.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/core/observer.d.ts +0 -23
- package/dist/packages/eva.js/lib/core/observer.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/decorators/ide.d.ts +0 -2
- package/dist/packages/eva.js/lib/decorators/ide.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/decorators/system.d.ts +0 -11
- package/dist/packages/eva.js/lib/decorators/system.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/game/Game.d.ts +0 -72
- package/dist/packages/eva.js/lib/game/Game.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/game/Scene.d.ts +0 -12
- package/dist/packages/eva.js/lib/game/Scene.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/game/Ticker.d.ts +0 -25
- package/dist/packages/eva.js/lib/game/Ticker.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/index.d.ts +0 -26
- package/dist/packages/eva.js/lib/index.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/loader/Progress.d.ts +0 -21
- package/dist/packages/eva.js/lib/loader/Progress.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/loader/Resource.d.ts +0 -99
- package/dist/packages/eva.js/lib/loader/Resource.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/loader/resourceLoader.d.ts +0 -14
- package/dist/packages/eva.js/lib/loader/resourceLoader.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/timeline/index.d.ts +0 -40
- package/dist/packages/eva.js/lib/timeline/index.d.ts.map +0 -1
- package/dist/packages/eva.js/lib/timeline/utils.d.ts +0 -2
- package/dist/packages/eva.js/lib/timeline/utils.d.ts.map +0 -1
- package/dist/packages/plugin-a11y/lib/A11y.d.ts +0 -26
- package/dist/packages/plugin-a11y/lib/A11y.d.ts.map +0 -1
- package/dist/packages/plugin-a11y/lib/A11ySystem.d.ts +0 -54
- package/dist/packages/plugin-a11y/lib/A11ySystem.d.ts.map +0 -1
- package/dist/packages/plugin-a11y/lib/constant.d.ts +0 -34
- package/dist/packages/plugin-a11y/lib/constant.d.ts.map +0 -1
- package/dist/packages/plugin-a11y/lib/index.d.ts +0 -4
- package/dist/packages/plugin-a11y/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-a11y/lib/utils.d.ts +0 -6
- package/dist/packages/plugin-a11y/lib/utils.d.ts.map +0 -1
- package/dist/packages/plugin-evax/lib/EvaXComponent.d.ts +0 -20
- package/dist/packages/plugin-evax/lib/EvaXComponent.d.ts.map +0 -1
- package/dist/packages/plugin-evax/lib/EvaXSystem.d.ts +0 -33
- package/dist/packages/plugin-evax/lib/EvaXSystem.d.ts.map +0 -1
- package/dist/packages/plugin-evax/lib/index.d.ts +0 -10
- package/dist/packages/plugin-evax/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-evax/lib/utils.d.ts +0 -3
- package/dist/packages/plugin-evax/lib/utils.d.ts.map +0 -1
- package/dist/packages/plugin-matterjs/lib/BodiesFactory.d.ts +0 -31
- package/dist/packages/plugin-matterjs/lib/BodiesFactory.d.ts.map +0 -1
- package/dist/packages/plugin-matterjs/lib/Physics.d.ts +0 -32
- package/dist/packages/plugin-matterjs/lib/Physics.d.ts.map +0 -1
- package/dist/packages/plugin-matterjs/lib/PhysicsEngine.d.ts +0 -35
- package/dist/packages/plugin-matterjs/lib/PhysicsEngine.d.ts.map +0 -1
- package/dist/packages/plugin-matterjs/lib/PhysicsSystem.d.ts +0 -32
- package/dist/packages/plugin-matterjs/lib/PhysicsSystem.d.ts.map +0 -1
- package/dist/packages/plugin-matterjs/lib/index.d.ts +0 -5
- package/dist/packages/plugin-matterjs/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-matterjs/lib/matter.d.ts +0 -3
- package/dist/packages/plugin-matterjs/lib/matter.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/Renderer.d.ts +0 -19
- package/dist/packages/plugin-renderer/lib/Renderer.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/System.d.ts +0 -40
- package/dist/packages/plugin-renderer/lib/System.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/Transform.d.ts +0 -28
- package/dist/packages/plugin-renderer/lib/Transform.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/compressedTexture/ability.d.ts +0 -20
- package/dist/packages/plugin-renderer/lib/compressedTexture/ability.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/compressedTexture/fix/loader.d.ts +0 -2
- package/dist/packages/plugin-renderer/lib/compressedTexture/fix/loader.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/compressedTexture/index.d.ts +0 -7
- package/dist/packages/plugin-renderer/lib/compressedTexture/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/index.d.ts +0 -8
- package/dist/packages/plugin-renderer/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/manager/ContainerManager.d.ts +0 -18
- package/dist/packages/plugin-renderer/lib/manager/ContainerManager.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/manager/RendererManager.d.ts +0 -17
- package/dist/packages/plugin-renderer/lib/manager/RendererManager.d.ts.map +0 -1
- package/dist/packages/plugin-renderer/lib/mixin.d.ts +0 -2
- package/dist/packages/plugin-renderer/lib/mixin.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-dragonbone/lib/component.d.ts +0 -26
- package/dist/packages/plugin-renderer-dragonbone/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-dragonbone/lib/db.d.ts +0 -3
- package/dist/packages/plugin-renderer-dragonbone/lib/db.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-dragonbone/lib/engine.d.ts +0 -10
- package/dist/packages/plugin-renderer-dragonbone/lib/engine.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-dragonbone/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-dragonbone/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-dragonbone/lib/system.d.ts +0 -24
- package/dist/packages/plugin-renderer-dragonbone/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-event/lib/component.d.ts +0 -52
- package/dist/packages/plugin-renderer-event/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-event/lib/index.d.ts +0 -5
- package/dist/packages/plugin-renderer-event/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-event/lib/system.d.ts +0 -19
- package/dist/packages/plugin-renderer-event/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-graphics/lib/component.d.ts +0 -8
- package/dist/packages/plugin-renderer-graphics/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-graphics/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-graphics/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-graphics/lib/system.d.ts +0 -12
- package/dist/packages/plugin-renderer-graphics/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-img/lib/component.d.ts +0 -10
- package/dist/packages/plugin-renderer-img/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-img/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-img/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-img/lib/system.d.ts +0 -18
- package/dist/packages/plugin-renderer-img/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-lottie/lib/Lottie.d.ts +0 -27
- package/dist/packages/plugin-renderer-lottie/lib/Lottie.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-lottie/lib/LottieSystem.d.ts +0 -18
- package/dist/packages/plugin-renderer-lottie/lib/LottieSystem.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-lottie/lib/index.d.ts +0 -3
- package/dist/packages/plugin-renderer-lottie/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-lottie/lib/lottie-pixi.d.ts +0 -180
- package/dist/packages/plugin-renderer-lottie/lib/lottie-pixi.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-lottie/lib/types.d.ts +0 -18
- package/dist/packages/plugin-renderer-lottie/lib/types.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-lottie/lib/utils.d.ts +0 -2
- package/dist/packages/plugin-renderer-lottie/lib/utils.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-mask/lib/component.d.ts +0 -33
- package/dist/packages/plugin-renderer-mask/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-mask/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-mask/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-mask/lib/system.d.ts +0 -31
- package/dist/packages/plugin-renderer-mask/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-nine-patch/lib/component.d.ts +0 -22
- package/dist/packages/plugin-renderer-nine-patch/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-nine-patch/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-nine-patch/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-nine-patch/lib/system.d.ts +0 -19
- package/dist/packages/plugin-renderer-nine-patch/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-render/lib/component.d.ts +0 -17
- package/dist/packages/plugin-renderer-render/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-render/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-render/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-render/lib/system.d.ts +0 -17
- package/dist/packages/plugin-renderer-render/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-spine/lib/Spine.d.ts +0 -4
- package/dist/packages/plugin-renderer-spine/lib/Spine.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-spine/lib/SpineSystem.d.ts +0 -5
- package/dist/packages/plugin-renderer-spine/lib/SpineSystem.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-spine/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-spine/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-sprite/lib/component.d.ts +0 -12
- package/dist/packages/plugin-renderer-sprite/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-sprite/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-sprite/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-sprite/lib/system.d.ts +0 -17
- package/dist/packages/plugin-renderer-sprite/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-sprite-animation/lib/component.d.ts +0 -31
- package/dist/packages/plugin-renderer-sprite-animation/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-sprite-animation/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-sprite-animation/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-sprite-animation/lib/system.d.ts +0 -31
- package/dist/packages/plugin-renderer-sprite-animation/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-test/lib/component.d.ts +0 -20
- package/dist/packages/plugin-renderer-test/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-test/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-test/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-test/lib/system.d.ts +0 -21
- package/dist/packages/plugin-renderer-test/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-test/lib/system2.d.ts +0 -12
- package/dist/packages/plugin-renderer-test/lib/system2.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-text/lib/component.d.ts +0 -43
- package/dist/packages/plugin-renderer-text/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-text/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-text/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-text/lib/system.d.ts +0 -22
- package/dist/packages/plugin-renderer-text/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-tiling-sprite/lib/component.d.ts +0 -20
- package/dist/packages/plugin-renderer-tiling-sprite/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-tiling-sprite/lib/index.d.ts +0 -4
- package/dist/packages/plugin-renderer-tiling-sprite/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-renderer-tiling-sprite/lib/system.d.ts +0 -18
- package/dist/packages/plugin-renderer-tiling-sprite/lib/system.d.ts.map +0 -1
- package/dist/packages/plugin-sound/lib/Sound.d.ts +0 -44
- package/dist/packages/plugin-sound/lib/Sound.d.ts.map +0 -1
- package/dist/packages/plugin-sound/lib/SoundSystem.d.ts +0 -37
- package/dist/packages/plugin-sound/lib/SoundSystem.d.ts.map +0 -1
- package/dist/packages/plugin-sound/lib/index.d.ts +0 -3
- package/dist/packages/plugin-sound/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-stats/lib/Stats.d.ts +0 -19
- package/dist/packages/plugin-stats/lib/Stats.d.ts.map +0 -1
- package/dist/packages/plugin-stats/lib/StatsComponent.d.ts +0 -7
- package/dist/packages/plugin-stats/lib/StatsComponent.d.ts.map +0 -1
- package/dist/packages/plugin-stats/lib/StatsSystem.d.ts +0 -28
- package/dist/packages/plugin-stats/lib/StatsSystem.d.ts.map +0 -1
- package/dist/packages/plugin-stats/lib/hooks/BaseHooks.d.ts +0 -18
- package/dist/packages/plugin-stats/lib/hooks/BaseHooks.d.ts.map +0 -1
- package/dist/packages/plugin-stats/lib/hooks/GLHook.d.ts +0 -11
- package/dist/packages/plugin-stats/lib/hooks/GLHook.d.ts.map +0 -1
- package/dist/packages/plugin-stats/lib/hooks/TextureHook.d.ts +0 -16
- package/dist/packages/plugin-stats/lib/hooks/TextureHook.d.ts.map +0 -1
- package/dist/packages/plugin-stats/lib/index.d.ts +0 -9
- package/dist/packages/plugin-stats/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-transition/lib/Animation.d.ts +0 -38
- package/dist/packages/plugin-transition/lib/Animation.d.ts.map +0 -1
- package/dist/packages/plugin-transition/lib/component.d.ts.map +0 -1
- package/dist/packages/plugin-transition/lib/index.d.ts +0 -3
- package/dist/packages/plugin-transition/lib/index.d.ts.map +0 -1
- package/dist/packages/plugin-transition/lib/system.d.ts +0 -6
- package/dist/packages/plugin-transition/lib/system.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/Application.d.ts +0 -3
- package/dist/packages/renderer-adapter/lib/Application.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/Container.d.ts +0 -5
- package/dist/packages/renderer-adapter/lib/Container.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/Graphics.d.ts +0 -5
- package/dist/packages/renderer-adapter/lib/Graphics.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/NinePatch.d.ts +0 -5
- package/dist/packages/renderer-adapter/lib/NinePatch.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/Sprite.d.ts +0 -9
- package/dist/packages/renderer-adapter/lib/Sprite.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/SpriteAnimation.d.ts +0 -14
- package/dist/packages/renderer-adapter/lib/SpriteAnimation.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/Text.d.ts +0 -6
- package/dist/packages/renderer-adapter/lib/Text.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/TilingSprite.d.ts +0 -9
- package/dist/packages/renderer-adapter/lib/TilingSprite.d.ts.map +0 -1
- package/dist/packages/renderer-adapter/lib/index.d.ts +0 -9
- package/dist/packages/renderer-adapter/lib/index.d.ts.map +0 -1
- package/dist/packages/spine-base/lib/Spine.d.ts +0 -32
- package/dist/packages/spine-base/lib/Spine.d.ts.map +0 -1
- package/dist/packages/spine-base/lib/SpineData.d.ts +0 -5
- package/dist/packages/spine-base/lib/SpineData.d.ts.map +0 -1
- package/dist/packages/spine-base/lib/SpineSystem.d.ts +0 -20
- package/dist/packages/spine-base/lib/SpineSystem.d.ts.map +0 -1
- package/dist/packages/spine-base/lib/TexCache.d.ts +0 -10
- package/dist/packages/spine-base/lib/TexCache.d.ts.map +0 -1
- package/dist/packages/spine-base/lib/index.d.ts +0 -4
- package/dist/packages/spine-base/lib/index.d.ts.map +0 -1
|
@@ -2,39 +2,6 @@ window.EVA = window.EVA || {};
|
|
|
2
2
|
window.EVA.plugin = window.EVA.plugin || {};
|
|
3
3
|
var _EVA_IIFE_transition = function (exports, eva_js) {
|
|
4
4
|
'use strict';
|
|
5
|
-
var extendStatics = function (d, b) {
|
|
6
|
-
extendStatics = Object.setPrototypeOf || {
|
|
7
|
-
__proto__: []
|
|
8
|
-
} instanceof Array && function (d, b) {
|
|
9
|
-
d.__proto__ = b;
|
|
10
|
-
} || function (d, b) {
|
|
11
|
-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
12
|
-
};
|
|
13
|
-
return extendStatics(d, b);
|
|
14
|
-
};
|
|
15
|
-
function __extends(d, b) {
|
|
16
|
-
extendStatics(d, b);
|
|
17
|
-
function __() {
|
|
18
|
-
this.constructor = d;
|
|
19
|
-
}
|
|
20
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
21
|
-
}
|
|
22
|
-
function __values(o) {
|
|
23
|
-
var s = typeof Symbol === "function" && Symbol.iterator,
|
|
24
|
-
m = s && o[s],
|
|
25
|
-
i = 0;
|
|
26
|
-
if (m) return m.call(o);
|
|
27
|
-
if (o && typeof o.length === "number") return {
|
|
28
|
-
next: function () {
|
|
29
|
-
if (o && i >= o.length) o = void 0;
|
|
30
|
-
return {
|
|
31
|
-
value: o && o[i++],
|
|
32
|
-
done: !o
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
37
|
-
}
|
|
38
5
|
var Easing = {
|
|
39
6
|
Linear: {
|
|
40
7
|
None: function (amount) {
|
|
@@ -703,7 +670,7 @@ var _EVA_IIFE_transition = function (exports, eva_js) {
|
|
|
703
670
|
TWEEN.add.bind(TWEEN);
|
|
704
671
|
TWEEN.remove.bind(TWEEN);
|
|
705
672
|
TWEEN.update.bind(TWEEN);
|
|
706
|
-
|
|
673
|
+
const easingMap = {
|
|
707
674
|
linear: Easing.Linear.None,
|
|
708
675
|
'ease-in': Easing.Quadratic.In,
|
|
709
676
|
'ease-out': Easing.Quadratic.Out,
|
|
@@ -711,12 +678,10 @@ var _EVA_IIFE_transition = function (exports, eva_js) {
|
|
|
711
678
|
'bounce-in': Easing.Bounce.In,
|
|
712
679
|
'bounce-out': Easing.Bounce.Out,
|
|
713
680
|
'bounce-in-out': Easing.Bounce.InOut,
|
|
714
|
-
none:
|
|
715
|
-
return ~~p;
|
|
716
|
-
}
|
|
681
|
+
none: p => ~~p
|
|
717
682
|
};
|
|
718
|
-
|
|
719
|
-
|
|
683
|
+
class Animation {
|
|
684
|
+
constructor(timelines, tweenGroup) {
|
|
720
685
|
this.tweens = [];
|
|
721
686
|
this.timelines = [];
|
|
722
687
|
this.finishCount = 0;
|
|
@@ -726,20 +691,18 @@ var _EVA_IIFE_transition = function (exports, eva_js) {
|
|
|
726
691
|
this.timelines = timelines;
|
|
727
692
|
this.tweenGroup = tweenGroup;
|
|
728
693
|
}
|
|
729
|
-
|
|
694
|
+
on(eventName, callback) {
|
|
730
695
|
if (!this.callbacks[eventName]) {
|
|
731
696
|
this.callbacks.set(eventName, []);
|
|
732
697
|
}
|
|
733
698
|
this.callbacks.get(eventName).push(callback);
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
|
|
699
|
+
}
|
|
700
|
+
emit(eventName) {
|
|
701
|
+
const callbacks = this.callbacks.get(eventName);
|
|
737
702
|
if (!callbacks || !callbacks.length) return;
|
|
738
|
-
callbacks.forEach(
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
};
|
|
742
|
-
Animation.prototype.checkFinish = function () {
|
|
703
|
+
callbacks.forEach(fn => fn());
|
|
704
|
+
}
|
|
705
|
+
checkFinish() {
|
|
743
706
|
if (++this.finishCount == this.tweens.length) {
|
|
744
707
|
if (++this.currIteration == this.iteration) {
|
|
745
708
|
this.emit('finish');
|
|
@@ -748,138 +711,120 @@ var _EVA_IIFE_transition = function (exports, eva_js) {
|
|
|
748
711
|
this.start();
|
|
749
712
|
}
|
|
750
713
|
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
|
|
714
|
+
}
|
|
715
|
+
getObjectCache(component, name) {
|
|
716
|
+
const key = `${component.gameObject.id}${component.name}`;
|
|
754
717
|
if (!this.objectCache[key]) {
|
|
755
718
|
this.objectCache[key] = {};
|
|
756
719
|
}
|
|
757
720
|
if (this.objectCache[key][name]) {
|
|
758
721
|
return this.objectCache[key][name];
|
|
759
722
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
for (
|
|
723
|
+
const keys = name.split('.');
|
|
724
|
+
const keyIndex = keys.length - 1;
|
|
725
|
+
let property = component;
|
|
726
|
+
for (let i = 0; i < keyIndex; i++) {
|
|
764
727
|
property = property[keys[i]];
|
|
765
728
|
}
|
|
766
729
|
this.objectCache[key][name] = {
|
|
767
|
-
property
|
|
730
|
+
property,
|
|
768
731
|
key: keys[keyIndex]
|
|
769
732
|
};
|
|
770
733
|
return this.objectCache[key][name];
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
734
|
+
}
|
|
735
|
+
doAnim({
|
|
736
|
+
component,
|
|
737
|
+
name,
|
|
738
|
+
value
|
|
739
|
+
}) {
|
|
740
|
+
const {
|
|
741
|
+
property,
|
|
742
|
+
key
|
|
743
|
+
} = this.getObjectCache(component, name);
|
|
779
744
|
property[key] = value;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
var _this = this;
|
|
745
|
+
}
|
|
746
|
+
init() {
|
|
783
747
|
this.checkFinishFunc = this.checkFinish.bind(this);
|
|
784
|
-
|
|
785
|
-
this.timelines.forEach(
|
|
786
|
-
for (
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
748
|
+
let lastTween;
|
|
749
|
+
this.timelines.forEach((timeline, i) => {
|
|
750
|
+
for (let j = 0; j < timeline.values.length - 1; j++) {
|
|
751
|
+
const frame = timeline.values[j];
|
|
752
|
+
const nextFrame = timeline.values[j + 1];
|
|
753
|
+
const tween = new Tween({
|
|
790
754
|
value: frame.value
|
|
791
|
-
},
|
|
755
|
+
}, this.tweenGroup).to({
|
|
792
756
|
value: nextFrame.value
|
|
793
|
-
}).duration(nextFrame.time - frame.time).easing(easingMap[frame.tween]).onUpdate(
|
|
794
|
-
|
|
757
|
+
}).duration(nextFrame.time - frame.time).easing(easingMap[frame.tween]).onUpdate(props => {
|
|
758
|
+
this.doAnim({
|
|
795
759
|
component: timeline.component,
|
|
796
760
|
name: timeline.name,
|
|
797
761
|
value: props.value
|
|
798
762
|
});
|
|
799
763
|
});
|
|
800
764
|
if (j === 0) {
|
|
801
|
-
|
|
765
|
+
this.tweens[i] = tween;
|
|
802
766
|
} else {
|
|
803
767
|
lastTween.chain(tween);
|
|
804
768
|
}
|
|
805
769
|
lastTween = tween;
|
|
806
770
|
}
|
|
807
|
-
lastTween && lastTween.onComplete(
|
|
808
|
-
return _this.checkFinishFunc();
|
|
809
|
-
});
|
|
771
|
+
lastTween && lastTween.onComplete(() => this.checkFinishFunc());
|
|
810
772
|
});
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
if (iteration === void 0) {
|
|
814
|
-
iteration = 1;
|
|
815
|
-
}
|
|
773
|
+
}
|
|
774
|
+
play(iteration = 1, currentTime) {
|
|
816
775
|
this.currentTime = currentTime;
|
|
817
776
|
this.stoped = false;
|
|
818
777
|
this.start();
|
|
819
778
|
this.currIteration = 0;
|
|
820
779
|
this.iteration = iteration;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
var _this = this;
|
|
780
|
+
}
|
|
781
|
+
start() {
|
|
824
782
|
this.finishCount = 0;
|
|
825
783
|
this.tweens.length = 0;
|
|
826
784
|
this.init();
|
|
827
|
-
this.tweens.forEach(
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
this.tweens.forEach(
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
};
|
|
837
|
-
Animation.prototype.resume = function () {
|
|
838
|
-
var _this = this;
|
|
839
|
-
this.tweens.forEach(function (tween) {
|
|
840
|
-
return tween.resume(_this.currentTime);
|
|
841
|
-
});
|
|
842
|
-
};
|
|
843
|
-
Animation.prototype.stop = function () {
|
|
785
|
+
this.tweens.forEach(tween => tween.start(this.currentTime));
|
|
786
|
+
}
|
|
787
|
+
pause() {
|
|
788
|
+
this.tweens.forEach(tween => tween.pause(this.currentTime));
|
|
789
|
+
}
|
|
790
|
+
resume() {
|
|
791
|
+
this.tweens.forEach(tween => tween.resume(this.currentTime));
|
|
792
|
+
}
|
|
793
|
+
stop() {
|
|
844
794
|
this.stoped = true;
|
|
845
|
-
this.tweens.forEach(
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
};
|
|
849
|
-
Animation.prototype.destroy = function () {
|
|
795
|
+
this.tweens.forEach(tween => tween.stop());
|
|
796
|
+
}
|
|
797
|
+
destroy() {
|
|
850
798
|
this.stop();
|
|
851
799
|
this.tweens = null;
|
|
852
800
|
this.timelines = null;
|
|
853
801
|
this.objectCache = null;
|
|
854
802
|
this.callbacks.clear();
|
|
855
803
|
this.callbacks = null;
|
|
856
|
-
};
|
|
857
|
-
return Animation;
|
|
858
|
-
}();
|
|
859
|
-
var Animation$1 = Animation;
|
|
860
|
-
var Transition = function (_super) {
|
|
861
|
-
__extends(Transition, _super);
|
|
862
|
-
function Transition() {
|
|
863
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
864
|
-
_this.animations = {};
|
|
865
|
-
_this.group = {};
|
|
866
|
-
_this.currentTime = 0;
|
|
867
|
-
_this.needPlay = [];
|
|
868
|
-
return _this;
|
|
869
804
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
805
|
+
}
|
|
806
|
+
class Transition extends eva_js.Component {
|
|
807
|
+
constructor() {
|
|
808
|
+
super(...arguments);
|
|
809
|
+
this.animations = {};
|
|
810
|
+
this.group = {};
|
|
811
|
+
this.currentTime = 0;
|
|
812
|
+
this.needPlay = [];
|
|
813
|
+
}
|
|
814
|
+
init({
|
|
815
|
+
group
|
|
816
|
+
} = {
|
|
817
|
+
group: {}
|
|
818
|
+
}) {
|
|
874
819
|
this.group = group;
|
|
875
820
|
this.tweenGroup = new Group();
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
for (
|
|
879
|
-
this.newAnimation(
|
|
821
|
+
}
|
|
822
|
+
awake() {
|
|
823
|
+
for (const name in this.group) {
|
|
824
|
+
this.newAnimation(name);
|
|
880
825
|
}
|
|
881
|
-
}
|
|
882
|
-
|
|
826
|
+
}
|
|
827
|
+
play(name, iteration) {
|
|
883
828
|
if (!name) {
|
|
884
829
|
name = Object.keys(this.group)[0];
|
|
885
830
|
}
|
|
@@ -888,36 +833,36 @@ var _EVA_IIFE_transition = function (exports, eva_js) {
|
|
|
888
833
|
}
|
|
889
834
|
if (name && this.animations[name]) {
|
|
890
835
|
this.needPlay.push({
|
|
891
|
-
name
|
|
892
|
-
iteration
|
|
836
|
+
name,
|
|
837
|
+
iteration
|
|
893
838
|
});
|
|
894
839
|
}
|
|
895
|
-
}
|
|
896
|
-
|
|
840
|
+
}
|
|
841
|
+
stop(name) {
|
|
897
842
|
var _a, _b;
|
|
898
843
|
if (!name) {
|
|
899
|
-
for (
|
|
844
|
+
for (const key in this.animations) {
|
|
900
845
|
(_a = this.animations[key]) === null || _a === void 0 ? void 0 : _a.stop();
|
|
901
846
|
}
|
|
902
847
|
} else {
|
|
903
848
|
(_b = this.animations[name]) === null || _b === void 0 ? void 0 : _b.stop();
|
|
904
849
|
}
|
|
905
|
-
}
|
|
906
|
-
|
|
850
|
+
}
|
|
851
|
+
onPause() {
|
|
907
852
|
var _a;
|
|
908
|
-
for (
|
|
853
|
+
for (const key in this.animations) {
|
|
909
854
|
(_a = this.animations[key]) === null || _a === void 0 ? void 0 : _a.pause();
|
|
910
855
|
}
|
|
911
|
-
}
|
|
912
|
-
|
|
856
|
+
}
|
|
857
|
+
onResume() {
|
|
913
858
|
var _a;
|
|
914
|
-
for (
|
|
859
|
+
for (const key in this.animations) {
|
|
915
860
|
(_a = this.animations[key]) === null || _a === void 0 ? void 0 : _a.resume();
|
|
916
861
|
}
|
|
917
|
-
}
|
|
918
|
-
|
|
862
|
+
}
|
|
863
|
+
onDestroy() {
|
|
919
864
|
var _a;
|
|
920
|
-
for (
|
|
865
|
+
for (const key in this.animations) {
|
|
921
866
|
(_a = this.animations[key]) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
922
867
|
}
|
|
923
868
|
this.tweenGroup.removeAll();
|
|
@@ -925,58 +870,35 @@ var _EVA_IIFE_transition = function (exports, eva_js) {
|
|
|
925
870
|
this.group = null;
|
|
926
871
|
this.animations = null;
|
|
927
872
|
this.removeAllListeners();
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
var
|
|
931
|
-
var _b;
|
|
873
|
+
}
|
|
874
|
+
update(e) {
|
|
875
|
+
var _a;
|
|
932
876
|
this.currentTime = e.time;
|
|
933
|
-
for (
|
|
877
|
+
for (const key in this.animations) {
|
|
934
878
|
this.animations[key].currentTime = e.time;
|
|
935
879
|
}
|
|
936
880
|
this.tweenGroup.update(e.time);
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
var play = _d.value;
|
|
940
|
-
(_b = this.animations[play.name]) === null || _b === void 0 ? void 0 : _b.play(play.iteration, this.currentTime);
|
|
941
|
-
}
|
|
942
|
-
} catch (e_1_1) {
|
|
943
|
-
e_1 = {
|
|
944
|
-
error: e_1_1
|
|
945
|
-
};
|
|
946
|
-
} finally {
|
|
947
|
-
try {
|
|
948
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
949
|
-
} finally {
|
|
950
|
-
if (e_1) throw e_1.error;
|
|
951
|
-
}
|
|
881
|
+
for (const play of this.needPlay) {
|
|
882
|
+
(_a = this.animations[play.name]) === null || _a === void 0 ? void 0 : _a.play(play.iteration, this.currentTime);
|
|
952
883
|
}
|
|
953
884
|
this.needPlay.length = 0;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
animation.on('finish', function () {
|
|
959
|
-
return _this.emit('finish', name);
|
|
960
|
-
});
|
|
885
|
+
}
|
|
886
|
+
newAnimation(name) {
|
|
887
|
+
const animation = new Animation(this.group[name], this.tweenGroup);
|
|
888
|
+
animation.on('finish', () => this.emit('finish', name));
|
|
961
889
|
this.animations[name] = animation;
|
|
962
|
-
};
|
|
963
|
-
Transition.componentName = 'Transition';
|
|
964
|
-
return Transition;
|
|
965
|
-
}(eva_js.Component);
|
|
966
|
-
var Transition$1 = Transition;
|
|
967
|
-
var TransitionSystem = function (_super) {
|
|
968
|
-
__extends(TransitionSystem, _super);
|
|
969
|
-
function TransitionSystem() {
|
|
970
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
971
|
-
_this.name = 'transition';
|
|
972
|
-
return _this;
|
|
973
890
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
891
|
+
}
|
|
892
|
+
Transition.componentName = 'Transition';
|
|
893
|
+
class TransitionSystem extends eva_js.System {
|
|
894
|
+
constructor() {
|
|
895
|
+
super(...arguments);
|
|
896
|
+
this.name = 'transition';
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
TransitionSystem.systemName = 'transition';
|
|
900
|
+
exports.Transition = Transition;
|
|
901
|
+
exports.TransitionSystem = TransitionSystem;
|
|
980
902
|
Object.defineProperty(exports, '__esModule', {
|
|
981
903
|
value: true
|
|
982
904
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{};var _EVA_IIFE_transition=function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},n(t,e)};function i(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var r,o={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-o.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*o.Bounce.In(2*t):.5*o.Bounce.Out(2*t-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},a=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=s()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var r=this._tweens[n[i]],o=!e;r&&!1===r.update(t,o)&&!e&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),u={Linear:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),o=u.Utils.Linear;return e<0?o(t[0],t[1],i):e>1?o(t[n],t[n-1],n-i):o(t[r],t[r+1>n?n:r+1],i-r)},Bezier:function(t,e){for(var n=0,i=t.length-1,r=Math.pow,o=u.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-e,i-s)*r(e,s)*t[s]*o(i,s);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),o=u.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(i=n*(1+e))),o(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],i-r)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):o(t[r?r-1:0],t[r],t[n<r+1?n:r+1],t[n<r+2?n:r+2],i-r)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=u.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(r=[1],function(t){var e=1;if(r[t])return r[t];for(var n=t;n>1;n--)e*=n;return r[t]=e,e}),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),s=.5*(i-e),a=r*r;return(2*e-2*n+o+s)*(r*a)+(-3*e+3*n-2*o-s)*a+o*r+e}}},h=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),p=new a,c=function(){function t(t,e){void 0===e&&(e=p),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=o.Linear.None,this._interpolationFunction=u.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=h.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?s()+parseFloat(t):t:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,n,i){for(var r in n){var o=t[r],s=Array.isArray(o),a=s?"array":typeof o,u=!s&&Array.isArray(n[r]);if("undefined"!==a&&"function"!==a){if(u){var h=n[r];if(0===h.length)continue;h=h.map(this._handleRelativeValue.bind(this,o)),n[r]=[o].concat(h)}if("object"!==a&&!s||!o||u)void 0===e[r]&&(e[r]=o),s||(e[r]*=1),i[r]=u?n[r].slice().reverse():e[r]||0;else{for(var p in e[r]=s?[]:{},o)e[r][p]=o[p];i[r]=s?[]:{},this._setupProperties(o,e[r],n[r],i[r])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=s()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return this._group=t,this},t.prototype.delay=function(t){return this._delayTime=t,this},t.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return this._yoyo=t,this},t.prototype.easing=function(t){return this._easingFunction=t,this},t.prototype.interpolation=function(t){return this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){if(void 0===t&&(t=s()),void 0===e&&(e=!0),this._isPaused)return!0;var n,i,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),i=(t-this._startTime)/this._duration,i=0===this._duration||i>1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,u=this._chainedTweens.length;a<u;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,i){for(var r in n)if(void 0!==e[r]){var o=e[r]||0,s=n[r],a=Array.isArray(t[r]),u=Array.isArray(s);!a&&u?t[r]=this._interpolationFunction(s,i):"object"==typeof s&&s?this._updateProperties(t[r],o,s,i):"number"==typeof(s=this._handleRelativeValue(o,s))&&(t[r]=o+(s-o)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t}();h.nextId;var l=p;l.getAll.bind(l),l.removeAll.bind(l),l.add.bind(l),l.remove.bind(l),l.update.bind(l);var f={linear:o.Linear.None,"ease-in":o.Quadratic.In,"ease-out":o.Quadratic.Out,"ease-in-out":o.Quadratic.InOut,"bounce-in":o.Bounce.In,"bounce-out":o.Bounce.Out,"bounce-in-out":o.Bounce.InOut,none:function(t){return~~t}},_=function(){function t(t,e){this.tweens=[],this.timelines=[],this.finishCount=0,this.callbacks=new Map,this.objectCache={},this.currIteration=0,this.timelines=t,this.tweenGroup=e}return t.prototype.on=function(t,e){this.callbacks[t]||this.callbacks.set(t,[]),this.callbacks.get(t).push(e)},t.prototype.emit=function(t){var e=this.callbacks.get(t);e&&e.length&&e.forEach((function(t){return t()}))},t.prototype.checkFinish=function(){if(++this.finishCount==this.tweens.length)if(++this.currIteration==this.iteration)this.emit("finish");else{if(this.stoped)return;this.start()}},t.prototype.getObjectCache=function(t,e){var n=""+t.gameObject.id+t.name;if(this.objectCache[n]||(this.objectCache[n]={}),this.objectCache[n][e])return this.objectCache[n][e];for(var i=e.split("."),r=i.length-1,o=t,s=0;s<r;s++)o=o[i[s]];return this.objectCache[n][e]={property:o,key:i[r]},this.objectCache[n][e]},t.prototype.doAnim=function(t){var e=t.component,n=t.name,i=t.value,r=this.getObjectCache(e,n);r.property[r.key]=i},t.prototype.init=function(){var t,e=this;this.checkFinishFunc=this.checkFinish.bind(this),this.timelines.forEach((function(n,i){for(var r=0;r<n.values.length-1;r++){var o=n.values[r],s=n.values[r+1],a=new c({value:o.value},e.tweenGroup).to({value:s.value}).duration(s.time-o.time).easing(f[o.tween]).onUpdate((function(t){e.doAnim({component:n.component,name:n.name,value:t.value})}));0===r?e.tweens[i]=a:t.chain(a),t=a}t&&t.onComplete((function(){return e.checkFinishFunc()}))}))},t.prototype.play=function(t,e){void 0===t&&(t=1),this.currentTime=e,this.stoped=!1,this.start(),this.currIteration=0,this.iteration=t},t.prototype.start=function(){var t=this;this.finishCount=0,this.tweens.length=0,this.init(),this.tweens.forEach((function(e){return e.start(t.currentTime)}))},t.prototype.pause=function(){var t=this;this.tweens.forEach((function(e){return e.pause(t.currentTime)}))},t.prototype.resume=function(){var t=this;this.tweens.forEach((function(e){return e.resume(t.currentTime)}))},t.prototype.stop=function(){this.stoped=!0,this.tweens.forEach((function(t){return t.stop()}))},t.prototype.destroy=function(){this.stop(),this.tweens=null,this.timelines=null,this.objectCache=null,this.callbacks.clear(),this.callbacks=null},t}(),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animations={},e.group={},e.currentTime=0,e.needPlay=[],e}return i(e,t),e.prototype.init=function(t){var e=(void 0===t?{group:{}}:t).group;this.group=e,this.tweenGroup=new a},e.prototype.awake=function(){for(var t in this.group)this.newAnimation(t)},e.prototype.play=function(t,e){t||(t=Object.keys(this.group)[0]),t&&!this.animations[t]&&this.group[t]&&this.newAnimation(t),t&&this.animations[t]&&this.needPlay.push({name:t,iteration:e})},e.prototype.stop=function(t){var e,n;if(t)null===(n=this.animations[t])||void 0===n||n.stop();else for(var i in this.animations)null===(e=this.animations[i])||void 0===e||e.stop()},e.prototype.onPause=function(){var t;for(var e in this.animations)null===(t=this.animations[e])||void 0===t||t.pause()},e.prototype.onResume=function(){var t;for(var e in this.animations)null===(t=this.animations[e])||void 0===t||t.resume()},e.prototype.onDestroy=function(){var t;for(var e in this.animations)null===(t=this.animations[e])||void 0===t||t.destroy();this.tweenGroup.removeAll(),this.tweenGroup=null,this.group=null,this.animations=null,this.removeAllListeners()},e.prototype.update=function(t){var e,n,i;for(var r in this.currentTime=t.time,this.animations)this.animations[r].currentTime=t.time;this.tweenGroup.update(t.time);try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.needPlay),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=this.animations[a.name])||void 0===i||i.play(a.iteration,this.currentTime)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}this.needPlay.length=0},e.prototype.newAnimation=function(t){var e=this,n=new _(this.group[t],this.tweenGroup);n.on("finish",(function(){return e.emit("finish",t)})),this.animations[t]=n},e.componentName="Transition",e}(e.Component),y=d,v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="transition",e}return i(e,t),e.systemName="transition",e}(e.System),m=v;return t.Transition=y,t.TransitionSystem=m,Object.defineProperty(t,"__esModule",{value:!0}),t}({},EVA);window.EVA.plugin.transition=window.EVA.plugin.transition||_EVA_IIFE_transition;
|
|
1
|
+
window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{};var _EVA_IIFE_transition=function(t,e){"use strict";var i,n={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-n.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},r=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=s()),void 0===e&&(e=!1);var i=Object.keys(this._tweens);if(0===i.length)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var r=this._tweens[i[n]],o=!e;r&&!1===r.update(t,o)&&!e&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),o={Linear:function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n),r=o.Utils.Linear;return e<0?r(t[0],t[1],n):e>1?r(t[i],t[i-1],i-n):r(t[s],t[s+1>i?i:s+1],n-s)},Bezier:function(t,e){for(var i=0,n=t.length-1,s=Math.pow,r=o.Utils.Bernstein,a=0;a<=n;a++)i+=s(1-e,n-a)*s(e,a)*t[a]*r(n,a);return i},CatmullRom:function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n),r=o.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(s=Math.floor(n=i*(1+e))),r(t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i],n-s)):e<0?t[0]-(r(t[0],t[0],t[1],t[1],-n)-t[0]):e>1?t[i]-(r(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):r(t[s?s-1:0],t[s],t[i<s+1?i:s+1],t[i<s+2?i:s+2],n-s)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=o.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:(i=[1],function(t){var e=1;if(i[t])return i[t];for(var n=t;n>1;n--)e*=n;return i[t]=e,e}),CatmullRom:function(t,e,i,n,s){var r=.5*(i-t),o=.5*(n-e),a=s*s;return(2*e-2*i+r+o)*(s*a)+(-3*e+3*i-2*r-o)*a+r*s+e}}},a=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),h=new r,u=function(){function t(t,e){void 0===e&&(e=h),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=n.Linear.None,this._interpolationFunction=o.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=a.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?s()+parseFloat(t):t:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,i,n){for(var s in i){var r=t[s],o=Array.isArray(r),a=o?"array":typeof r,h=!o&&Array.isArray(i[s]);if("undefined"!==a&&"function"!==a){if(h){var u=i[s];if(0===u.length)continue;u=u.map(this._handleRelativeValue.bind(this,r)),i[s]=[r].concat(u)}if("object"!==a&&!o||!r||h)void 0===e[s]&&(e[s]=r),o||(e[s]*=1),n[s]=h?i[s].slice().reverse():e[s]||0;else{for(var c in e[s]=o?[]:{},r)e[s][c]=r[c];n[s]=o?[]:{},this._setupProperties(r,e[s],i[s],n[s])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=s()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return this._group=t,this},t.prototype.delay=function(t){return this._delayTime=t,this},t.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return this._yoyo=t,this},t.prototype.easing=function(t){return this._easingFunction=t,this},t.prototype.interpolation=function(t){return this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){if(void 0===t&&(t=s()),void 0===e&&(e=!0),this._isPaused)return!0;var i,n,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var o=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(i in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,h=this._chainedTweens.length;a<h;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,n){for(var s in i)if(void 0!==e[s]){var r=e[s]||0,o=i[s],a=Array.isArray(t[s]),h=Array.isArray(o);!a&&h?t[s]=this._interpolationFunction(o,n):"object"==typeof o&&o?this._updateProperties(t[s],r,o,n):"number"==typeof(o=this._handleRelativeValue(r,o))&&(t[s]=r+(o-r)*n)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t}();a.nextId;var c=h;c.getAll.bind(c),c.removeAll.bind(c),c.add.bind(c),c.remove.bind(c),c.update.bind(c);const p={linear:n.Linear.None,"ease-in":n.Quadratic.In,"ease-out":n.Quadratic.Out,"ease-in-out":n.Quadratic.InOut,"bounce-in":n.Bounce.In,"bounce-out":n.Bounce.Out,"bounce-in-out":n.Bounce.InOut,none:t=>~~t};class l{constructor(t,e){this.tweens=[],this.timelines=[],this.finishCount=0,this.callbacks=new Map,this.objectCache={},this.currIteration=0,this.timelines=t,this.tweenGroup=e}on(t,e){this.callbacks[t]||this.callbacks.set(t,[]),this.callbacks.get(t).push(e)}emit(t){const e=this.callbacks.get(t);e&&e.length&&e.forEach((t=>t()))}checkFinish(){if(++this.finishCount==this.tweens.length)if(++this.currIteration==this.iteration)this.emit("finish");else{if(this.stoped)return;this.start()}}getObjectCache(t,e){const i=`${t.gameObject.id}${t.name}`;if(this.objectCache[i]||(this.objectCache[i]={}),this.objectCache[i][e])return this.objectCache[i][e];const n=e.split("."),s=n.length-1;let r=t;for(let t=0;t<s;t++)r=r[n[t]];return this.objectCache[i][e]={property:r,key:n[s]},this.objectCache[i][e]}doAnim({component:t,name:e,value:i}){const{property:n,key:s}=this.getObjectCache(t,e);n[s]=i}init(){let t;this.checkFinishFunc=this.checkFinish.bind(this),this.timelines.forEach(((e,i)=>{for(let n=0;n<e.values.length-1;n++){const s=e.values[n],r=e.values[n+1],o=new u({value:s.value},this.tweenGroup).to({value:r.value}).duration(r.time-s.time).easing(p[s.tween]).onUpdate((t=>{this.doAnim({component:e.component,name:e.name,value:t.value})}));0===n?this.tweens[i]=o:t.chain(o),t=o}t&&t.onComplete((()=>this.checkFinishFunc()))}))}play(t=1,e){this.currentTime=e,this.stoped=!1,this.start(),this.currIteration=0,this.iteration=t}start(){this.finishCount=0,this.tweens.length=0,this.init(),this.tweens.forEach((t=>t.start(this.currentTime)))}pause(){this.tweens.forEach((t=>t.pause(this.currentTime)))}resume(){this.tweens.forEach((t=>t.resume(this.currentTime)))}stop(){this.stoped=!0,this.tweens.forEach((t=>t.stop()))}destroy(){this.stop(),this.tweens=null,this.timelines=null,this.objectCache=null,this.callbacks.clear(),this.callbacks=null}}class d extends e.Component{constructor(){super(...arguments),this.animations={},this.group={},this.currentTime=0,this.needPlay=[]}init({group:t}={group:{}}){this.group=t,this.tweenGroup=new r}awake(){for(const t in this.group)this.newAnimation(t)}play(t,e){t||(t=Object.keys(this.group)[0]),t&&!this.animations[t]&&this.group[t]&&this.newAnimation(t),t&&this.animations[t]&&this.needPlay.push({name:t,iteration:e})}stop(t){var e,i;if(t)null===(i=this.animations[t])||void 0===i||i.stop();else for(const t in this.animations)null===(e=this.animations[t])||void 0===e||e.stop()}onPause(){var t;for(const e in this.animations)null===(t=this.animations[e])||void 0===t||t.pause()}onResume(){var t;for(const e in this.animations)null===(t=this.animations[e])||void 0===t||t.resume()}onDestroy(){var t;for(const e in this.animations)null===(t=this.animations[e])||void 0===t||t.destroy();this.tweenGroup.removeAll(),this.tweenGroup=null,this.group=null,this.animations=null,this.removeAllListeners()}update(t){var e;this.currentTime=t.time;for(const e in this.animations)this.animations[e].currentTime=t.time;this.tweenGroup.update(t.time);for(const t of this.needPlay)null===(e=this.animations[t.name])||void 0===e||e.play(t.iteration,this.currentTime);this.needPlay.length=0}newAnimation(t){const e=new l(this.group[t],this.tweenGroup);e.on("finish",(()=>this.emit("finish",t))),this.animations[t]=e}}d.componentName="Transition";class _ extends e.System{constructor(){super(...arguments),this.name="transition"}}return _.systemName="transition",t.Transition=d,t.TransitionSystem=_,Object.defineProperty(t,"__esModule",{value:!0}),t}({},EVA);window.EVA.plugin.transition=window.EVA.plugin.transition||_EVA_IIFE_transition;
|