NodeStateData.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. const {ccclass: o, property: a} = cc._decorator,
  18. n = function () {
  19. return this.node && this._edit;
  20. };
  21. e = class {
  22. constructor() {
  23. (this.nodeState = null),
  24. (this._node = null),
  25. (this._edit = !1),
  26. (this.x = !1),
  27. (this.y = !1),
  28. (this.width = !1),
  29. (this.height = !1),
  30. (this.scaleX = !1),
  31. (this.scaleY = !1),
  32. (this.active = !1),
  33. (this.angle = !1),
  34. (this.opacity = !1),
  35. (this.color = !1),
  36. (this.frame = !1),
  37. (this.str = !1),
  38. (this.lab_o_c = !1);
  39. }
  40. set node(t) {
  41. if (t) {
  42. if (t !== this._node) {
  43. for (const e of this.nodeState.nodeList)
  44. if (e.node == t) return void cc.warn("已经存在相同的节点,不能重复添加");
  45. this._node && this.nodeState.removeNode(this._node), (this._node = t);
  46. }
  47. } else this.nodeState.removeNodeData(this), (this.nodeState = null);
  48. }
  49. get node() {
  50. return this._node;
  51. }
  52. set edit(t) {
  53. this._edit = t;
  54. }
  55. get edit() {
  56. return this._edit;
  57. }
  58. };
  59. s([a(cc.Node)], e.prototype, "_node", void 0),
  60. s([a({type: cc.Node})], e.prototype, "node", null),
  61. s([a()], e.prototype, "_edit", void 0),
  62. s([a()], e.prototype, "edit", null),
  63. s([a({visible: n})], e.prototype, "x", void 0),
  64. s([a({visible: n})], e.prototype, "y", void 0),
  65. s([a({visible: n})], e.prototype, "width", void 0),
  66. s([a({visible: n})], e.prototype, "height", void 0),
  67. s([a({visible: n})], e.prototype, "scaleX", void 0),
  68. s([a({visible: n})], e.prototype, "scaleY", void 0),
  69. s([a({visible: n})], e.prototype, "active", void 0),
  70. s([a({visible: n})], e.prototype, "angle", void 0),
  71. s([a({visible: n})], e.prototype, "opacity", void 0),
  72. s([a({visible: n})], e.prototype, "color", void 0),
  73. s(
  74. [
  75. a({
  76. visible: function () {
  77. return this.node && this.node.getComponent(cc.Sprite) && this._edit;
  78. }
  79. })
  80. ],
  81. e.prototype,
  82. "frame",
  83. void 0
  84. ),
  85. s(
  86. [
  87. a({
  88. visible: function () {
  89. return this.node && this.node.getComponent(cc.Label) && this._edit;
  90. }
  91. })
  92. ],
  93. e.prototype,
  94. "str",
  95. void 0
  96. ),
  97. s(
  98. [
  99. a({
  100. visible: function () {
  101. return this.node && this.node.getComponent(cc.LabelOutline) && this._edit;
  102. }
  103. })
  104. ],
  105. e.prototype,
  106. "lab_o_c",
  107. void 0
  108. ),
  109. (e = s([o("NodeStateData")], e)),
  110. (i.default = e);