123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- 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 l = t("MoneyAni"),
- o = t("OpenSysAni"),
- h = (t("LayerManager"), t("BagController")),
- _ = t("App"),
- a = t("NodePool"),
- n = t("QueueExecutor");
- (t = {})[(t.Score = 0)] = "Score";
- const {ccclass: r, property: c} = cc._decorator;
- t = s = class extends cc.Component {
- constructor() {
- super(...arguments),
- (this.queueExecutor = null),
- (this.openSysAniPrefab = null),
- (this.openSysAni = null),
- (this.moneyAniPre = null),
- (this.moneyAniPool = null);
- }
- onLoad() {
- (this.queueExecutor = new n.QueueExecutor()),
- ((s.instance = this).moneyAniPool = new a.default()),
- (this.moneyAniPool.prefab = this.moneyAniPre);
- }
- playLockAni(e) {
- this.queueExecutor.regist(() => {
- let t = this.openSysAni;
- t || (this.openSysAni = t = cc.instantiate(this.openSysAniPrefab)),
- t.parent || (_.default.ViewManager.uiRoot.addChild(t), (t.zIndex = 100)),
- t.getComponent(o.default).play(e);
- }, this);
- }
- coinEffect1(i, s, o, a, n = 0, r, l = 7, h = 45) {
- let c = 0;
- var d = o / Math.abs(o),
- u = a / Math.abs(a);
- let p = !1;
- for (let e = 0; e < l; e++) {
- let t = this.pool.pop();
- 11 == Math.floor(n / 1e6)
- ? (t.getComponent(MoneyIcon).moneyType = n)
- : (t.getComponent(cc.Sprite).spriteFrame = this.frames[n]),
- (t.x = i),
- (t.y = s),
- (t.active = !1),
- (t.height = t.width = h);
- var f = Math.sqrt(Math.pow(i - o, 2) + Math.pow(s - a, 2));
- Math.sqrt(Math.pow(i - o, 2) + Math.pow(s - a, 2));
- var g = cc.v2(i + 200 * d, s - 300 * u);
- cc.v2((g.x + o) / 2, (g.y + a) / 2),
- cc
- .tween(t)
- .delay(c)
- .set({active: !0})
- .to(f / 1e3, {x: o, y: a}, {easing: cc.easing.quadOut})
- .delay(0.01)
- .call(() => {
- this.pool.push(t),
- e == l - 1 && this.queueExecutor.finishFunc(),
- p || ((p = !0), _.default.SoundManager.playEffect("get_coin2"));
- })
- .start(),
- (c += 0.1),
- r.addChild(t),
- (t.zIndex = 110);
- }
- }
- coinEffect2(i, s, o, a, n = 0, r, l = 7, h = 45) {
- let c = 0;
- var d = o / Math.abs(o),
- u = a / Math.abs(a);
- let p = !1;
- for (let e = 0; e < l; e++) {
- let t = this.pool.pop();
- 11 == Math.floor(n / 1e6)
- ? (t.getComponent(MoneyIcon).moneyType = n)
- : (t.getComponent(cc.Sprite).spriteFrame = this.frames[n]),
- (t.x = i),
- (t.y = s),
- (t.active = !1),
- (t.height = t.width = h);
- var f = Math.sqrt(Math.pow(i - o, 2) + Math.pow(s - a, 2)),
- g = cc.v2(i + 200 * d, s - 300 * u),
- m = cc.v2((g.x + o) / 2, (g.y + a) / 2);
- cc
- .tween(t)
- .delay(c)
- .set({active: !0})
- .bezierTo(f / 1200, g, m, cc.v2(o, a))
- .delay(0.01)
- .call(() => {
- this.pool.push(t),
- e == l - 1 && this.queueExecutor.finishFunc(),
- p || ((p = !0), _.default.SoundManager.playEffect("get_coin2"));
- })
- .start(),
- (c += 0.1),
- r.addChild(t),
- (t.zIndex = 110);
- }
- }
- coinEffect(e, i, s, o, a = 0, n, r = 20, l = 45, h = 800, c = 500) {
- let d = 0;
- (e -= l / 2), (i -= l / 2);
- let u = !1;
- for (let t = 0; t < r; t++) {
- let t = this.pool.pop();
- t.getComponent(cc.Sprite).spriteFrame = this.frames[a];
- var p = (0.5 - Math.random()) * h + e,
- f = (0.5 - Math.random()) * c + i;
- (t.x = e), (t.y = i), (t.active = !1), (t.height = t.width = l);
- var g = Math.sqrt(Math.pow(p - s, 2) + Math.pow(f - o, 2)),
- m = 1.3 * Math.sqrt(Math.pow(e - p, 2) + Math.pow(i - f, 2));
- cc
- .tween(t)
- .delay(d)
- .set({active: !0})
- .to(m / 1e3, {x: p, y: f}, {easing: cc.easing.quadOut})
- .to(g / 1e3, {x: s, y: o}, {easing: cc.easing.circIn})
- .delay(0.01)
- .call(() => {
- this.pool.push(t), u || ((u = !0), _.default.SoundManager.playEffect("get_coin2"));
- })
- .start(),
- (d += 0.01),
- n.addChild(t),
- (t.zIndex = 110);
- }
- }
- typerEffect(t, e = "", i = 200, s, o) {
- let a = 0,
- n = function () {
- t.string += e[a++];
- };
- var r = e.length;
- return (t.string = ""), _.default.TimerManager.doTimer(i, r, n, o, s, o), n;
- }
- scaleEffect(t, e = 0.94) {
- return cc
- .tween(t)
- .to(0.5, {scale: e}, cc.easeSineInOut())
- .to(0.5, {scale: 1}, cc.easeSineInOut())
- .union()
- .repeatForever()
- .start();
- }
- rotationEffect(t, e = 2) {
- return cc.tween(t).by(e, {angle: 360}).repeatForever().start();
- }
- rockObj(t, e = 0.08, i = 5, s = 0.7) {
- cc.tween(t)
- .repeatForever(
- cc
- .tween()
- .to(e, {angle: i})
- .to(2 * e, {angle: -i})
- .to(2 * e, {angle: i})
- .to(2 * e, {angle: -i})
- .to(e, {angle: 0})
- .delay(s)
- )
- .start();
- }
- flyObj(t, e, i = 50) {
- return cc.tween(t).by(e, {y: i}).by(e, {y: -i}).union().repeatForever().start();
- }
- playMoneyAni(t, e, i = 0, s, o, a) {
- let n = this.moneyAniPool.pop();
- const r = n.getComponent(l.MoneyAni);
- s.addChild(n), (n.zIndex = 110), (n.position = t);
- t = Math.sqrt(t.sub(e).magSqr()) / 900;
- 2e4 < i && (i %= h.CostType.coin),
- r.playAni(
- e,
- i,
- t,
- () => {
- a && a(), this.moneyAniPool.push(n);
- },
- o
- );
- }
- };
- e([c(cc.Prefab)], t.prototype, "openSysAniPrefab", void 0),
- e([c(cc.Prefab)], t.prototype, "moneyAniPre", void 0),
- (t = s = e([r], t)),
- (i.default = t = s);
|