Commit 62f31006 authored by wildfirecode's avatar wildfirecode

1

parent f6ecede4
......@@ -48,7 +48,7 @@ import { createData } from '../startScene/StartScene';
import { Loading2 } from '../something/uis/Loading2';
import { BonusTime } from '../something/uis/BonusTime';
import { NetName } from '../../libs/tw/enum/NetName';
import { playGameBg } from '../soundCtrl2';
import { playGameBg, getGameBgOn } from '../soundCtrl2';
const aniClass = {
"BoomAni": BoomAni,
......@@ -196,8 +196,15 @@ export default class MainScene extends Scene {
stepCircle: egret.Shape;
//bonus Time 提示
bonusTime: BonusTime;
initSound(){
this['soundBtn'].visible = getSoundOn();
this['soundOffBtn'].visible = !getSoundOn();
this['musicBtn'].visible = getGameBgOn();
this['musicOffBtn'].visible = !getGameBgOn();
}
start(data) {
super.start();
this.initSound();
stopBg();
playGameBg();
//初始化索引信息
......
let bgOn = true;
let bgChannel: egret.SoundChannel;
let loading = false;
export const getGameBgOn = () => {
return bgOn
}
export const toggleGameBg = () => {
bgOn = !bgOn;
if (bgChannel) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment