"use strict";
cc._RF.push(module, '280c3rsZJJKnZ9RqbALVwtK', 'HelloWorld');
// Script/HelloWorld.js

"use strict";

cc.Class({
  "extends": cc.Component,
  properties: {
    label: {
      "default": null,
      type: cc.Label
    },
    animNode: cc.Node,
    // defaults, set visually when attaching this script to the Canvas
    text: 'Hello, World!'
  },
  // use this for initialization
  onLoad: function onLoad() {
    this.label.string = this.text;
  },
  start: function start() {
    var _this = this;

    this.animComponent = this.animNode.getComponent(cc.Animation);
    cc.resources.loadDir('shot_goal', cc.SpriteFrame, null, function (err, spriteFrames) {
      if (!err) {
        // cc.log(spriteFrames);
        console.log(spriteFrames); // for(let item of spriteFrames){
        //     let rect = item.getRect();
        //     rect.x = 0;
        //     rect.y = 0;
        //     rect.width = 750;
        //     rect.height = 750;
        //     item.setRect(rect);
        // }

        var clip = cc.AnimationClip.createWithSpriteFrames(spriteFrames, 30);
        clip.name = 'shot_goal';
        clip.wrapMode = cc.WrapMode.Normal;
        clip.speed = 1.5;

        _this.animComponent.addClip(clip);

        _this.animComponent.play('shot_goal');
      }
    });
  },
  // called every frame
  update: function update(dt) {}
});

cc._RF.pop();