Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbx_pageturn
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
Sbx_pageturn
Commits
da3a1f25
Commit
da3a1f25
authored
Nov 20, 2020
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试监听后台
parent
33b0bcf2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
Scene.js
play/assets/tmpGame/script/Scene.js
+13
-8
No files found.
play/assets/tmpGame/script/Scene.js
View file @
da3a1f25
...
...
@@ -123,13 +123,13 @@ cc.Class({
}
})
cc
.
game
.
on
(
cc
.
game
.
EVENT_HIDE
,
function
()
{
console
.
log
(
"
cc.game.EVENT_HIDE
"
);
})
;
cc
.
game
.
on
(
cc
.
game
.
EVENT_SHOW
,
function
()
{
console
.
log
(
"
cc.game.EVENT_HIDE
"
);
window
.
addEventListener
(
'
message
'
,(
e
)
=>
{
console
.
log
(
'
message
'
)
console
.
log
(
e
)
let
msgData
=
e
.
data
;
if
(
msgData
.
action
===
"
course-ready
"
)
{
this
.
stopBgm
(
);
}
});
},
...
...
@@ -202,9 +202,14 @@ cc.Class({
return
;
}
cc
.
assetManager
.
loadRemote
(
this
.
data
.
contentObj
.
bgm_url
,
null
,
(
err
,
clip
)
=>
{
cc
.
audioEngine
.
play
(
clip
,
true
,
1
);
this
.
bgAudioId
=
cc
.
audioEngine
.
play
(
clip
,
true
,
1
);
});
},
stopBgm
(){
if
(
this
.
bgAudioId
){
cc
.
audioEngine
.
stop
(
this
.
bgAudioId
);
}
},
initData
()
{
// 所有全局变量 默认都是null
...
...
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