Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NS03
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
NS03
Commits
874dc9a4
Commit
874dc9a4
authored
Jan 05, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理题干音频乱播问题
parent
7bcf7521
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
NS03.meta
assets/NS03.meta
+15
-1
laba.ts
assets/NS03/scene/laba.ts
+7
-0
pg.ts
assets/NS03/scene/pg.ts
+1
-1
No files found.
assets/NS03.meta
View file @
874dc9a4
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/NS03/scene/laba.ts
View file @
874dc9a4
...
...
@@ -16,6 +16,8 @@ export default class NewClass extends cc.Component {
onLoad
()
{
pg
.
view
.
touchOn
(
this
.
node
,
this
.
onTouchLaba
,
this
);
pg
.
event
.
on
(
"
play_stem
"
,
()
=>
{
cc
.
audioEngine
.
stopAllEffects
();
this
.
playing
=
false
;
this
.
onTouchLaba
().
then
(()
=>
{
pg
.
event
.
emit
(
"
game_start_loop
"
)
})
...
...
@@ -27,16 +29,21 @@ export default class NewClass extends cc.Component {
}
onTouchLaba
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
playing
)
return
;
this
.
playing
=
true
;
this
.
showAni
();
pg
.
audio
.
playAudioByUrl
(
Game
.
getIns
().
nowAudio
).
then
(()
=>
{
this
.
playing
=
false
;
this
.
stopAni
();
resolve
(
''
);
})
});
}
private
playing
:
boolean
;
private
count
:
number
;
showAni
()
{
this
.
count
=
0
;
this
.
labaAni
();
this
.
schedule
(
this
.
labaAni
,
0.1
);
}
stopAni
()
{
...
...
assets/NS03/scene/pg.ts
View file @
874dc9a4
...
...
@@ -437,7 +437,7 @@ let pg = {
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
:
any
)
=>
{
const
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.8
);
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
resolve
(
audio
Clip
);
resolve
(
audio
Id
);
});
});
});
...
...
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