var aGameInstance = require('../GameInstance'); cc.Class({ extends: cc.Component, properties: { LoadingBG: { default: null, type: cc.Node, serializable: true, }, TalkingLabel: { default: null, type: cc.Label, serializable: true, }, TalkingSpNode: { default: null, type: cc.Node, serializable: true, }, AudioControllerNode: { default: null, type: cc.Node, serializable: true, }, }, onLoad () { this.bRunScene = true; this.AudioControllerScp = this.AudioControllerNode.getComponent('AudioController'); this.AudioControllerScp.playBGM('Game/Audios/BGM/Funny.wav',1,()=>{ this.bRunScene = false; this.LoadingBG.active = false; }); this.TalkingSpNodeScp = this.TalkingSpNode.getComponent('TalkingSp'); }, Menu(event, param) { if(this.bRunScene) { return; } this.bRunScene = true; this.AudioControllerScp.stopAll(); //取消这个组件得所有计时器 this.unscheduleAllCallbacks(); aGameInstance.sceneIdx = parseInt(param); this.scheduleOnce(()=>{ cc.director.loadScene("Game"); },0.1); }, Help(event, param) { this.TalkingSpNodeScp.PlayScaleAni(); switch (parseInt(param)) { case 0: this.TalkingLabel.string = '三秒时正好打中沙袋获胜!'; break; case 1: this.TalkingLabel.string = '十秒时正好打中沙袋获胜,小心时间流速变快了哦!'; break; case 2: this.TalkingLabel.string = '连续“三次”随机生成目标时间,打中三次获胜!哈哈,难度越来越高了!'; break; case 3: this.TalkingLabel.string = '连续“三次”随机生成目标时间,打中三次获胜。小心!这次时间可不一定正着流动哦!'; break; default: break; } } });