Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
duiduipeng
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
duiduipeng
Commits
d9ba4c8b
Commit
d9ba4c8b
authored
May 16, 2022
by
章红平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
8c10068e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
.DS_Store
.DS_Store
+0
-0
duiduipeng.ts
assets/duiduipeng/scene/duiduipeng.ts
+3
-4
MyCocosSceneComponent.ts
assets/duiduipeng/script/MyCocosSceneComponent.ts
+4
-2
No files found.
.DS_Store
View file @
d9ba4c8b
No preview for this file type
assets/duiduipeng/scene/duiduipeng.ts
View file @
d9ba4c8b
...
...
@@ -305,9 +305,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
this
.
canTouch
=
false
if
(
this
.
clickNodeData1
.
pairIdx
==
data
.
pairIdx
)
{
this
.
asyncPlayAudioByUrl
(
data
.
audio
)
//
this.asyncPlayAudioByUrl(data.audio)
Promise
.
all
([
node
.
getComponent
(
"
card
"
).
asyncDoFlip
()])
.
all
([
node
.
getComponent
(
"
card
"
).
asyncDoFlip
()
,
this
.
asyncPlayAudioByUrl
(
data
.
audio
)
])
.
then
(()
=>
{
this
.
playLocalAudio
(
"
true
"
)
Promise
.
all
([
node
.
getComponent
(
"
card
"
).
playDragon
(),
this
.
clickNode1
.
getComponent
(
"
card
"
).
playDragon
()])
...
...
@@ -339,9 +339,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
)
}
else
{
this
.
asyncPlayAudioByUrl
(
data
.
audio
)
Promise
.
all
([
node
.
getComponent
(
"
card
"
).
asyncDoFlip
()])
.
all
([
node
.
getComponent
(
"
card
"
).
asyncDoFlip
()
,
this
.
asyncPlayAudioByUrl
(
data
.
audio
)
])
.
then
(()
=>
{
this
.
playLocalAudio
(
"
false
"
)
// Promise.all([this.playLocalAudio("false")])
...
...
assets/duiduipeng/script/MyCocosSceneComponent.ts
View file @
d9ba4c8b
...
...
@@ -173,6 +173,7 @@ export class MyCocosSceneComponent extends cc.Component {
}
asyncPlayAudioByUrl
(
audio_url
,
cb
=
null
)
{
// audio_url="ooooo"
if
(
audio_url
)
{
console
.
log
(
"
audio_url===
"
,
audio_url
)
return
new
Promise
((
resole
,
reject
)
=>
{
...
...
@@ -187,14 +188,15 @@ export class MyCocosSceneComponent extends cc.Component {
}
else
{
if
(
cb
)
cb
();
console
.
log
(
"
asyncPlayAudioByUrlerr=====
"
,
err
)
resole
(
null
);
}
})
})
}
else
{
cb
&&
cb
();
return
Promise
.
resolve
();
}
}
}
\ No newline at end of file
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