System.register(["cc"], function (_export, _context) {
  "use strict";

  var _cclegacy, _decorator, Node, Sprite, Animation, UITransform, resources, SpriteAtlas, AnimationClip, _dec, _class, _crd, ccclass, property, RoleSprite;

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      Node = _cc.Node;
      Sprite = _cc.Sprite;
      Animation = _cc.Animation;
      UITransform = _cc.UITransform;
      resources = _cc.resources;
      SpriteAtlas = _cc.SpriteAtlas;
      AnimationClip = _cc.AnimationClip;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "511193eofNJi7Na74/3EDN0", "RoleSprite", undefined);

      ({
        ccclass,
        property
      } = _decorator);

      _export("RoleSprite", RoleSprite = (_dec = ccclass('RoleSprite'), _dec(_class = class RoleSprite extends Node {
        constructor() {
          super();
          this.addComponent(Animation);
          let sprite = this.addComponent(Sprite);
          sprite.trim = true;
          sprite.sizeMode = Sprite.SizeMode.TRIMMED;
          const uiTrans = this.getComponent(UITransform);
          uiTrans.setContentSize(512, 512);
        }

        onLoad(parent, type = 0) {
          let thisSelf = this;
          let start = "stand00";
          let aniLst = ["roles/test/stand"];
          resources.load(aniLst, SpriteAtlas, function (error, assets) {
            if (error) {
              console.log(error.message);
              return;
            }

            let spriteFrames = [];

            for (var i = 0; i < 10; i++) {
              let name = start + i.toString();
              let spriteFrame = assets[0].getSpriteFrame(name);
              spriteFrames.push(spriteFrame);
            }

            let animation = thisSelf.getComponent(Animation);
            let clip = AnimationClip.createWithSpriteFrames(spriteFrames, 18);
            clip.wrapMode = AnimationClip.WrapMode.Loop;
            clip.name = "stand";
            animation.createState(clip);
            parent.addChild(thisSelf);
            animation.play("stand");
          });
        }

      }) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=RoleSprite.js.map