"use strict";
cc._RF.push(module, '8bef1qWbgZAO4ASuJr1SSeF', 'main');
// script/main.js

"use strict";

var Hero = require("Hero");

cc.Class({
  "extends": cc.Component,
  properties: {
    prefab: cc.Prefab
  },
  // LIFE-CYCLE CALLBACKS:
  onLoad: function onLoad() {
    this.Sprite = cc.find("Sprite", this.node);
  },
  start: function start() {
    this.anim1 = cc.instantiate(this.prefab);
    this.anim1.parent = this.node;
    this.anim1.x = -300;
    this.anim1.getComponent(Hero).playBoneAnim();
    this.anim1.getComponent(Hero).setCompleteFunc(function () {
      // this.scheduleOnce(function () {
      //     this.anim1.getComponent(Hero).playBoneAnim();
      // });
      this.anim1.getComponent(Hero).playBoneAnim();
    }.bind(this));
    this.anim2 = cc.instantiate(this.prefab);
    this.anim2.parent = this.node;
    this.anim2.x = 300;
    this.anim2.getComponent(Hero).playBoneAnim();
    this.anim2.getComponent(Hero).setCompleteFunc(function () {
      this.scheduleOnce(function () {
        this.anim2.getComponent(Hero).playBoneAnim();
      });
    }.bind(this));
  },
  loadRes: function loadRes() {
    cc.loader.loadRes("", cc.Prefab, function (completedCount, totalCount) {
      /*if (callback && completedCount < totalCount){
          callback(true, completedCount/totalCount);//预制体按个数来就行，子资源没必要展示出来
      }*/
    }, function (err, assets) {});
  } // update (dt) {},

});

cc._RF.pop();