var t = require; var e = module; var i = exports; var s = (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 { ccclass: o, property: a, menu: n, requireComponent: r, executeInEditMode: l } = cc._decorator; e = class extends cc.Component { constructor() { super(...arguments), (this.fames = []), (this._frameIndex = 0), (this.sprite = null); } set frameIndex(t) { null == t ? (this._frameIndex = t) : t !== this._frameIndex && this.switch(t); } get frameIndex() { return this._frameIndex; } get framNum() { return this.fames.length; } onLoad() { this.sprite || (this.sprite = this.getComponent(cc.Sprite)); } start() { this.switch(this._frameIndex); } switch (t) { this.sprite && this.sprite.spriteFrame !== this.fames[t] && this.fames[t] && (this.sprite.spriteFrame = this.fames[t]), (this._frameIndex = t); } }; s([a({ type: cc.SpriteFrame })], e.prototype, "fames", void 0), s([a()], e.prototype, "frameIndex", null), s([a(cc.Sprite)], e.prototype, "sprite", void 0), (e = s([o, r(cc.Sprite), l], e)), (i.default = e);