Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn04_classify
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
sn04_classify
Commits
90ce9c4a
Commit
90ce9c4a
authored
Oct 09, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8376e2fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
sn04_classify.ts
assets/sn04_classify/scene/sn04_classify.ts
+5
-2
No files found.
assets/sn04_classify/scene/sn04_classify.ts
View file @
90ce9c4a
...
@@ -449,11 +449,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -449,11 +449,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
playLocalAudio
(
audioName
)
{
playLocalAudio
(
audioName
)
{
let
noStop
=
audioName
==
"
count
"
;
let
noStop
=
audioName
==
"
count
"
;
if
(
!
noStop
)
this
.
stopBgmAdudio
();
//
if (!noStop) this.stopBgmAdudio();
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
if
(
!
noStop
)
this
.
resumeBgmMusic
();
});
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
// if (!noStop) this.resumeBgmMusic();
});
})
})
}
}
private
bgmId
;
private
bgmId
;
...
...
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