Car.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. e =
  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. const s = t("App"),
  18. o = t("GlobalAttr"),
  19. a = t("BaseMan"),
  20. {ccclass: n, property: r} = cc._decorator;
  21. t = class extends a.default {
  22. constructor() {
  23. super(...arguments),
  24. (this.posData = null),
  25. (this.carPosData = null),
  26. (this.isEixt = !1),
  27. (this.isReadyReceive = !1),
  28. (this.orders = []),
  29. (this.orderNode = null);
  30. }
  31. start() {
  32. super.start(), this.calSpeed(), this.sp.setSkin(s.default.RandomUtils.randomArray(["cat_yellow", "cat_blue"]));
  33. }
  34. calSpeed() {
  35. this.moveSpeed = o.default.ins.customerMoveSpeed;
  36. }
  37. sitDown() {
  38. (this.state = a.CharactorState.sitdown), (this.direction = this.posData.sit.direction);
  39. }
  40. exit(t) {
  41. this.orders.remove(t), 0 === this.orders.length && ((this.state = a.CharactorState.stand), (this.isEixt = !0));
  42. }
  43. destroySelf() {
  44. this.node.destroy();
  45. }
  46. };
  47. e([r(cc.Node)], t.prototype, "orderNode", void 0), (t = e([n], t)), (i.default = t);