123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- var t = require;
- var e = module;
- var i = exports;
- 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 s = t("App"),
- o = t("GameText"),
- {ccclass: a, property: n} = cc._decorator;
- let r = [],
- l = class extends cc.Component {
- constructor() {
- super(...arguments), (this.lab = null), (this.nextTipTime = 0), (this.index = 0);
- }
- onLoad() {
- if (!r.length) {
- let t = 1;
- for (;;) {
- var e = "game_help_tip_" + t++,
- i = o.GameText.getTextByStr(e);
- if (i == e) break;
- r.push(i);
- }
- s.default.RandomUtils.shuffle(r);
- }
- this.showNextLab();
- }
- showNextLab() {
- (this.lab.string = r[this.index]), this.index++, this.index == r.length && (this.index = 0);
- }
- update(t) {
- 5 < this.nextTipTime ? ((this.nextTipTime = 0), this.showNextLab()) : (this.nextTipTime += t);
- }
- };
- e([n(cc.Label)], l.prototype, "lab", void 0), (l = e([a], l)), (i.default = l);
|