mytest_main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Learn cc.Class:
  2. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
  3. // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
  4. // Learn Attribute:
  5. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
  6. // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
  7. // Learn life-cycle callbacks:
  8. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
  9. // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
  10. cc.Class({
  11. extends: cc.Component,
  12. properties: {
  13. readgo: cc.Node
  14. },
  15. // LIFE-CYCLE CALLBACKS:
  16. onLoad() {
  17. this.readgo.getChildByName("readyGo").getComponent(dragonBones.ArmatureDisplay).playAnimation("animation", 1);
  18. this.readgo.getChildByName("readyGoBg").getComponent(cc.Animation).play();
  19. // this.readgo.getComponent(cc.AudioSource).play();
  20. this.scheduleOnce(function () {
  21. this.readgo.active = false;
  22. }.bind(this), 2)
  23. },
  24. start() {
  25. },
  26. // update (dt) {},
  27. });