| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- var aGameInstance = require('../GameInstance');
- cc.Class({
- extends: cc.Component,
- properties: {
- TalkingLabel: {
- default: null,
- type: cc.Label,
- 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;
- });
- },
- 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)
- {
- 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;
- }
- }
- });
|