Commit 6188fd65 authored by wildfirecode's avatar wildfirecode

1

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