| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- cc.Class({
- extends: cc.Component,
- properties: {
- AudioArr: { //音频
- type: cc.AudioClip,
- default: [],
- },
- },
- // LIFE-CYCLE CALLBACKS:
- onLoad() {
- cc.audioEngine.playMusic(this.AudioArr[0]);
- // this.init();
- this.progressBar = this.node.getChildByName('prograss_bg').getChildByName('Loading_Bar').getComponent(cc.Sprite);
- this.startGame();
- },
- start() {
- },
- /**开始游戏 */
- startGame() {
- // cc.resources.loadDir("", cc.Asset, (completeCount, totalCount) => {
- // this.progressBar.fillRange = completeCount / totalCount;
- // }, () => {
- // this.node.removeAllChildren(true);
- // this.node.active = false;
- // this.UiController.change_interface(this.UiController.interfacaArr, 0);
- // });
- cc.resources.loadDir("texture", (completeCount, totalCount) => {
- this.progressBar.fillRange = completeCount / totalCount;
- }, () => {
- cc.director.preloadScene("Game", function() {
- cc.director.loadScene("Game");
- });
- });
- },
- // update (dt) {},
- init() {
- this.game = cc.find("Canvas/Game");
- this.UiController = cc.find("Canvas/UiController").getComponent('UiController');
- },
- });
|