Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
24a5fae8
Commit
24a5fae8
authored
Aug 30, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
f6ecede4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
MainScene.ts
egret/src/mainScene/MainScene.ts
+9
-7
soundCtrl2.ts
egret/src/soundCtrl2.ts
+3
-1
No files found.
egret/src/mainScene/MainScene.ts
View file @
24a5fae8
...
@@ -48,7 +48,7 @@ import { createData } from '../startScene/StartScene';
...
@@ -48,7 +48,7 @@ import { createData } from '../startScene/StartScene';
import
{
Loading2
}
from
'../something/uis/Loading2'
;
import
{
Loading2
}
from
'../something/uis/Loading2'
;
import
{
BonusTime
}
from
'../something/uis/BonusTime'
;
import
{
BonusTime
}
from
'../something/uis/BonusTime'
;
import
{
NetName
}
from
'../../libs/tw/enum/NetName'
;
import
{
NetName
}
from
'../../libs/tw/enum/NetName'
;
import
{
playGameBg
}
from
'../soundCtrl2'
;
import
{
playGameBg
,
toggleGameBg
,
getGameBgOn
}
from
'../soundCtrl2'
;
const
aniClass
=
{
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
"BoomAni"
:
BoomAni
,
...
@@ -198,8 +198,6 @@ export default class MainScene extends Scene {
...
@@ -198,8 +198,6 @@ export default class MainScene extends Scene {
bonusTime
:
BonusTime
;
bonusTime
:
BonusTime
;
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
stopBg
();
playGameBg
();
//初始化索引信息
//初始化索引信息
Tool
.
init
();
Tool
.
init
();
//第几关
//第几关
...
@@ -371,9 +369,12 @@ export default class MainScene extends Scene {
...
@@ -371,9 +369,12 @@ export default class MainScene extends Scene {
this
.
soundBtn
.
source
=
"mainSoundBtnOff_png"
this
.
soundBtn
.
source
=
"mainSoundBtnOff_png"
}
}
if
(
getBgOn
())
{
if
(
getBgOn
())
{
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
;
stopBg
();
playGameBg
();
}
else
{
}
else
{
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
;
stopBg
();
}
}
//初始化道具信息
//初始化道具信息
var
arrObj
=
[
"boomBtnNum"
,
"hammerBtnNum"
,
"stepBtnNum"
];
var
arrObj
=
[
"boomBtnNum"
,
"hammerBtnNum"
,
"stepBtnNum"
];
...
@@ -757,8 +758,9 @@ export default class MainScene extends Scene {
...
@@ -757,8 +758,9 @@ export default class MainScene extends Scene {
}
}
}
}
onTap_musicBtn
()
{
onTap_musicBtn
()
{
toggleBg
();
// toggleBg();
if
(
getBgOn
())
{
toggleGameBg
();
if
(
getGameBgOn
())
{
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
}
else
{
}
else
{
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
...
...
egret/src/soundCtrl2.ts
View file @
24a5fae8
let
bgOn
=
true
;
let
bgOn
=
true
;
let
bgChannel
:
egret
.
SoundChannel
;
let
bgChannel
:
egret
.
SoundChannel
;
let
loading
=
false
;
let
loading
=
false
;
export
const
getGameBgOn
=
()
=>
{
return
bgOn
}
export
const
toggleGameBg
=
()
=>
{
export
const
toggleGameBg
=
()
=>
{
bgOn
=
!
bgOn
;
bgOn
=
!
bgOn
;
if
(
bgChannel
)
{
if
(
bgChannel
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment