Commit 6188fd65 authored by wildfirecode's avatar wildfirecode

1

parent 35e452bb
import { DataManager } from './../../libs/tw/manager/DataManager';
import { NetManager } from './../../libs/tw/manager/NetManager';
import { Buried } from './../../libs/tw/util/Buried';
import { Tool } from '../something/Tool';
import { drawBg, generateMapBg, drawShape } from '../something/logic/aaa';
import { ChapterData } from '../something/interface/ChapterData';
import { Lattice } from '../something/class/Lattice';
import { Pool } from '../something/Pool';
import { RecoverName } from '../something/enum/RecoverName';
import { Element } from '../something/class/Element';
import { ElementType, submitTran, codeMsgs } from '../something/enum/ElementType';
import { EffectType } from '../something/enum/EffectType';
import getResPath from '../../libs/new_tc/getResPath';
import Scene from '../../libs/new_wx/components/Scene';
import PanelCtrl from '../../libs/new_wx/ctrls/panelCtrl';
import SceneCtrl from '../../libs/new_wx/ctrls/sceneCtrl';
import { showToast } from '../../libs/new_wx/ctrls/toastCtrl';
import { ModuleTypes } from '../../libs/new_wx/types/sceneTypes';
import { getPropNums } from '../getHomeData';
import { getlogItem } from '../Main';
import PropType from '../PropType';
import { BonusShootAni, stepPosition } from '../something/anis/BonusShootAni';
import { BoomAni } from '../something/anis/BoomAni';
import { IceAni } from '../something/anis/IceAni';
import { RockAni } from '../something/anis/RockAni';
import { Ice } from '../something/class/Ice';
import { HorizontalAni } from '../something/anis/HorizontalAni';
import { VerticalAni } from '../something/anis/VerticalAni';
import { CrossAni } from '../something/anis/CrossAni';
import { ThreeCrossAni } from '../something/anis/ThreeCrossAni';
import { EleDisAni } from '../something/anis/EleDisAni';
import { MagicRotateData } from '../something/interface/MagicRotateData';
import { MagicRotateAni } from '../something/anis/MagicRotateAni';
import { FlyTargetAni } from '../something/anis/FlyTargetAni';
import { HorizontalAni } from '../something/anis/HorizontalAni';
import { IceAni } from '../something/anis/IceAni';
import { MagicLionAni } from '../something/anis/MagicLionAni';
import { StepNumber } from '../something/uis/StepNumber';
import { MagicRotateAni } from '../something/anis/MagicRotateAni';
import { RockAni } from '../something/anis/RockAni';
import { ScoreAni } from '../something/anis/ScoreAni';
import { ThreeCrossAni } from '../something/anis/ThreeCrossAni';
import { VerticalAni } from '../something/anis/VerticalAni';
import { Chapters } from '../something/Chapters';
import { Element } from '../something/class/Element';
import { Ice } from '../something/class/Ice';
import { Lattice } from '../something/class/Lattice';
import { EffectType } from '../something/enum/EffectType';
import { codeMsgs, ElementType, submitTran } from '../something/enum/ElementType';
import { PassType } from '../something/enum/PassType';
import { RecoverName } from '../something/enum/RecoverName';
import { ChapterData } from '../something/interface/ChapterData';
import { ElementTargetData } from '../something/interface/ElementTargetData';
import { ScoreAni } from '../something/anis/ScoreAni';
import { ScoreProgress } from '../something/uis/ScoreProgress';
import { playSound, SoundType, toggleSound, toggleBg, getSoundOn, getBgOn, stopBg } from '../soundCtrl';
import Scene from '../../libs/new_wx/components/Scene';
import { showToast } from '../../libs/new_wx/ctrls/toastCtrl';
import getResPath from '../../libs/new_tc/getResPath';
import PanelCtrl from '../../libs/new_wx/ctrls/panelCtrl';
import { ModuleTypes } from '../../libs/new_wx/types/sceneTypes';
import { MagicRotateData } from '../something/interface/MagicRotateData';
import { drawBg, drawShape, generateMapBg } from '../something/logic/aaa';
import { Pool } from '../something/Pool';
import { Tool } from '../something/Tool';
import { BonusTime } from '../something/uis/BonusTime';
import { ElementTargets } from '../something/uis/ElementTargets';
import { Chapters } from '../something/Chapters';
import { FlyTargetAni } from '../something/anis/FlyTargetAni';
import { BonusShootAni, stepPosition } from '../something/anis/BonusShootAni';
import { GuideMsg } from '../something/uis/GuideMsg';
import { getlogItem } from '../Main';
import getHomeData, { getPropNums } from '../getHomeData';
import PropType from '../PropType';
import { PropNumShow } from '../something/uis/PropNumShow';
import SceneCtrl from '../../libs/new_wx/ctrls/sceneCtrl';
import { Loading2 } from '../something/uis/Loading2';
import { PropGuide } from '../something/uis/PropGuide';
import { PropNumShow } from '../something/uis/PropNumShow';
import { ScoreProgress } from '../something/uis/ScoreProgress';
import { StepNumber } from '../something/uis/StepNumber';
import { getBgOn, getSoundOn, playSound, SoundType, stopBg, toggleSound } from '../soundCtrl';
import { playGameBg, toggleGameBg } from '../soundCtrl2';
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, toggleGameBg, getGameBgOn, setGameBgStatus } from '../soundCtrl2';
import { DataManager } from './../../libs/tw/manager/DataManager';
import { NetManager } from './../../libs/tw/manager/NetManager';
import { Buried } from './../../libs/tw/util/Buried';
const aniClass = {
"BoomAni": BoomAni,
......@@ -373,11 +371,11 @@ export default class MainScene extends Scene {
this.musicBtn.source = "mainMusicBtnOn_png";
stopBg();
playGameBg();
setGameBgStatus(true);
// setGameBgStatus(true);
} else {
this.musicBtn.source = "mainMusicBtnOff_png";
stopBg();
setGameBgStatus(false);
// setGameBgStatus(false);
}
//初始化道具信息
var arrObj = ["boomBtnNum", "hammerBtnNum", "stepBtnNum"];
......@@ -763,7 +761,7 @@ export default class MainScene extends Scene {
onTap_musicBtn() {
// toggleBg();
toggleGameBg();
if (getGameBgOn()) {
if (getBgOn()) {
this.musicBtn.source = "mainMusicBtnOn_png"
} else {
this.musicBtn.source = "mainMusicBtnOff_png"
......
......@@ -12,6 +12,11 @@ export const getBgOn = () => {
export const toggleSound = () => {
soundOn = !soundOn;
}
export const toggleBgStatus = ()=>{
bgOn = !bgOn;
}
export const toggleBg = () => {
bgOn = !bgOn;
if (bgChannel) {
......
let bgOn = true;
import { getBgOn, toggleBgStatus } from "./soundCtrl";
let bgChannel: egret.SoundChannel;
let loading = false;
export const setGameBgStatus = (b:boolean) => {
bgOn = b;
}
export const getGameBgOn = () => {
return bgOn
}
export const toggleGameBg = () => {
bgOn = !bgOn;
toggleBgStatus();
const bgOn=getBgOn();
if (bgChannel) {
if (!bgOn) {
bgChannel.stop();
......
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