73c7e57181d0e2d635a6af8fb5af69feb2610a5c.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. System.register(["__unresolved_0", "cc", "__unresolved_1"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, Component, sp, _decorator, oops, _dec, _class, _class2, _descriptor, _crd, ccclass, property, SpineFinishedRelease;
  4. function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
  5. function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
  6. function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
  7. function _reportPossibleCrUseOfoops(extras) {
  8. _reporterNs.report("oops", "../../../core/Oops", _context.meta, extras);
  9. }
  10. return {
  11. setters: [function (_unresolved_) {
  12. _reporterNs = _unresolved_;
  13. }, function (_cc) {
  14. _cclegacy = _cc.cclegacy;
  15. __checkObsolete__ = _cc.__checkObsolete__;
  16. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  17. Component = _cc.Component;
  18. sp = _cc.sp;
  19. _decorator = _cc._decorator;
  20. }, function (_unresolved_2) {
  21. oops = _unresolved_2.oops;
  22. }],
  23. execute: function () {
  24. _crd = true;
  25. _cclegacy._RF.push({}, "9589eKB/RZKXpxoYhz5SyC7", "SpineFinishedRelease", undefined);
  26. /*
  27. * @Author: dgflash
  28. * @Date: 2021-10-12 14:11:04
  29. * @LastEditors: dgflash
  30. * @LastEditTime: 2022-04-08 15:42:16
  31. */
  32. __checkObsolete__(['Component', 'sp', '_decorator']);
  33. ({
  34. ccclass,
  35. property
  36. } = _decorator);
  37. /** 动画播放完隐藏特效 */
  38. _export("SpineFinishedRelease", SpineFinishedRelease = (_dec = ccclass('SpineFinishedRelease'), _dec(_class = (_class2 = class SpineFinishedRelease extends Component {
  39. constructor() {
  40. super(...arguments);
  41. _initializerDefineProperty(this, "isDestroy", _descriptor, this);
  42. this.spine = void 0;
  43. this.resPath = null;
  44. }
  45. /** 设置路径 */
  46. setResPath(path) {
  47. this.resPath = path;
  48. }
  49. onLoad() {
  50. this.spine = this.getComponent(sp.Skeleton);
  51. this.spine.setCompleteListener(this.onSpineComplete.bind(this));
  52. if (this.resPath) {
  53. (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
  54. error: Error()
  55. }), oops) : oops).res.load(this.resPath, sp.SkeletonData, (err, sd) => {
  56. if (err) {
  57. console.error("\u52A0\u8F7D\u3010" + this.resPath + "\u3011\u7684 SPINE \u8D44\u6E90\u4E0D\u5B58\u5728");
  58. return;
  59. }
  60. this.spine.skeletonData = sd;
  61. this.spine.setAnimation(0, "animation", false);
  62. });
  63. } else {
  64. this.spine.setAnimation(0, "animation", false);
  65. }
  66. }
  67. onSpineComplete() {
  68. if (this.isDestroy) {
  69. this.node.destroy();
  70. } else {
  71. this.node.removeFromParent();
  72. }
  73. }
  74. }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "isDestroy", [property], {
  75. configurable: true,
  76. enumerable: true,
  77. writable: true,
  78. initializer: function initializer() {
  79. return true;
  80. }
  81. })), _class2)) || _class));
  82. _cclegacy._RF.pop();
  83. _crd = false;
  84. }
  85. };
  86. });
  87. //# sourceMappingURL=73c7e57181d0e2d635a6af8fb5af69feb2610a5c.js.map