var t = require; var e = module; var i = exports; var s, e = (this && this.__decorate) || function(t, e, i, s) { var o, a = arguments.length, n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s); else for (var r = t.length - 1; 0 <= r; r--) (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n); return 3 < a && n && Object.defineProperty(e, i, n), n; }; Object.defineProperty(i, "__esModule", { value: !0 }); const o = t("App"), { ccclass: a, property: n, menu: r, executeInEditMode: l, executionOrder: h } = cc._decorator; let c = { TopToBottom: { run: function(t, e) { let i = cc.tween(t).to(0.6, { y: 0 }, { easing: cc.easing.bounceOut }); e && i.call(e), (t.y = cc.winSize.height), i.start(); }, fast: function(t, e) { e && e(), (t.y = 0); } }, test: { run: function(t, e) { (t.y = cc.winSize.height / 2 - 230), (t.x = cc.winSize.width / 2 - 15), (t.scale = 0); let i = cc .tween(t) .parallel( cc.tween().bezierTo(0.3, t.position, cc.v2(t.x / 2, t.y + 100), cc.Vec2.ZERO), cc.tween().to(0.3, { scale: 1 }, cc.easeExponentialIn()) ); e && i.call(e), i.start(); }, fast: function(t, e) { e && e(), (t.y = 0); } }, BottomToTop: { run: function(t, e) { let i = cc.tween(t).to(0.5, { y: cc.winSize.height }, { easing: cc.easing.cubicOut }); e && i.call(e), i.start(); }, fast: function(t, e) { e && e(), (t.y = 0); } }, Enter_BottomToTop: { run: function(t, e) { t.y -= cc.winSize.height; let i = cc.tween(t).to(0.3, { y: 0 }, { easing: cc.easing.backOut }); e && i.call(e), i.start(); }, fast: function(t, e) { e && e(), (t.y = 0); } }, Exit_CenterToBottom: { run: function(t, e) { let i = cc.tween(t).to(0.3, { y: -cc.winSize.height }, { easing: cc.easing.backOut }); e && i.call(e), i.start(); }, fast: function(t, e) { e && e(), (t.y = 0); } } }, d = (s = class extends cc.Component { constructor() { super(...arguments), (this._enterAniAsset = null), (this._exitAniAsset = null), (this._enterTweenName = ""), (this._exitTweenName = ""), (this._ani = null), (this.isExiting = !1), (this._exitAni = 0), (this._enterAni = 0), (this.view = null), (this._isFirst = !0), (this._curScale = 1); } get exitAni() { return this._exitAni; } set exitAni(t) { this._exitAni !== t && ((this._exitAni = t), (this._exitAniAsset = null), (this._exitTweenName = ""), t) && ("string" == typeof(t = s.viewAnis[t]) ? (this._exitTweenName = t) : (this._exitAniAsset = t)); } isExitAni() { return (this._exitAniAsset || this._exitTweenName) && s.isCanPlayAni; } get enterAni() { return this._enterAni; } set enterAni(t) { this._enterAni !== t && ((this._enterAni = t), (this._enterAniAsset = null), (this._enterTweenName = ""), t) && ("string" == typeof(t = s.viewAnis[t]) ? (this._enterTweenName = t) : (this._enterAniAsset = t)); } start() {} onEnterAnimCompleted() { this.view.enterAniFinish(); } onAnimCompleted() { this.isExiting && ((this.isExiting = !1), this.node.parent && this.node.parent.removeChild(this.node, !1), (this.node.active = !1), (this.node.scale = this._curScale), o.default.ViewManager.checkIsNeedAddBg(), this.view.onExitAniFinish()); } onEnter() { if (this.enabled) if (this._isFirst && s.isCanPlayAni) { let e = this.node.opacity; (this.node.opacity = 0), o.default.TimerManager.setFrameOut( 2, () => { (this.node.opacity = e), this.playEnterAni(); let t = this.getComponent(cc.Widget); t && (t.enabled = !1); }, this ), (this._isFirst = !1); } else this.playEnterAni(); this.isExiting = !1; } playEnterAni() { this._enterAniAsset ? (s.isCanPlayAni ? this._ani.play(this._enterAniAsset.name) : this._ani.play(this._enterAniAsset.name, this._enterAniAsset.duration), this._ani.once(cc.Animation.EventType.FINISHED, this.onEnterAnimCompleted, this)) : this._enterTweenName && c[this._enterTweenName] && (s.isCanPlayAni ? c[this._enterTweenName].run(this.node, this.onEnterAnimCompleted.bind(this)) : (c[this._enterTweenName].fast(this.node), this.onEnterAnimCompleted())); } onExit() { s.isCanPlayAni && ((this.isExiting = !0), this.enabled && ((this._curScale = this.node.scale), this._exitAniAsset ? (this._ani.once(cc.Animation.EventType.FINISHED, this.onAnimCompleted, this), this._ani.play(this._exitAniAsset.name)) : this._exitTweenName && c[this._exitTweenName] && c[this._exitTweenName].run(this.node, this.onAnimCompleted.bind(this)))); } onLoad() { (this._enterAniAsset || this._exitAniAsset) && ((this._ani = this.addComponent(cc.Animation)), this._enterAniAsset && this._ani.addClip(this._enterAniAsset), this._exitAniAsset && this._ani.addClip(this._exitAniAsset)); } }); (d.isCanPlayAni = !0), (d.viewAnis = null), e([n(cc.AnimationClip)], d.prototype, "_enterAniAsset", void 0), e([n(cc.AnimationClip)], d.prototype, "_exitAniAsset", void 0), e([n()], d.prototype, "_enterTweenName", void 0), e([n()], d.prototype, "_exitTweenName", void 0), e([n({ editorOnly: !0 })], d.prototype, "_exitAni", void 0), e([n({ type: cc.Enum({}) })], d.prototype, "exitAni", null), e([n({ editorOnly: !0 })], d.prototype, "_enterAni", void 0), e([n({ type: cc.Enum({}) })], d.prototype, "enterAni", null), (s = e([a, l, h(-1)], d)), (i.default = s);