rootmusci.ts 902 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
  7. const { ccclass, property } = cc._decorator;
  8. @ccclass
  9. export default class BGM extends cc.Component {
  10. // LIFE-CYCLE CALLBACKS:
  11. @property(cc.Prefab)
  12. boli: cc.Prefab = null;
  13. onLoad() {
  14. // cc.resources.load('BGGGG', cc.AudioClip, (err, clips: cc.AudioClip) => {
  15. // if (err) {
  16. // cc.error(err);
  17. // return;
  18. // }
  19. // cc.audioEngine.playMusic(clips, true); // 播放音乐
  20. // });
  21. // cc.audioEngine.playMusic(boli, true); // 播放音乐
  22. }
  23. // update (dt) {}
  24. }