OrderDisplay.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. var s =
  5. (this && this.__decorate) ||
  6. function (t, e, i, s) {
  7. var o,
  8. a = arguments.length,
  9. n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
  10. if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
  11. else
  12. for (var r = t.length - 1; 0 <= r; r--)
  13. (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
  14. return 3 < a && n && Object.defineProperty(e, i, n), n;
  15. };
  16. Object.defineProperty(i, "__esModule", {value: !0});
  17. var {ccclass: e} = cc._decorator,
  18. e = s(
  19. [e],
  20. (e = class extends cc.Component {
  21. constructor() {
  22. super(...arguments), (this.food = null), (this.cntLab = null);
  23. }
  24. onLoad() {
  25. (this.food = this.node.getChildByName("Food").getComponent(cc.Sprite)),
  26. (this.cntLab = this.node.getChildByName("CntLab").getComponent(cc.Label));
  27. }
  28. setData(t) {
  29. (this.cntLab.string = t.cnt + ""), (this.food.spriteFrame = t.machine.foodImg.spriteFrame);
  30. }
  31. setCnt(t) {
  32. this.cntLab.string = t + "";
  33. }
  34. destroySelf() {
  35. this.node.pool.push(this.node);
  36. }
  37. })
  38. );
  39. i.default = e;