Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP51
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
OP51
Commits
528f74f4
Commit
528f74f4
authored
Oct 14, 2022
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分音频不播放动画的问题
parent
3447ae7f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
OP51.js
assets/OP51/scene/OP51.js
+11
-1
No files found.
assets/OP51/scene/OP51.js
View file @
528f74f4
...
@@ -436,9 +436,11 @@ cc.Class({
...
@@ -436,9 +436,11 @@ cc.Class({
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
// 一局失败弹出tryagain,同时下方录音按钮明亮并出现提示
// 一局失败弹出tryagain,同时下方录音按钮明亮并出现提示
this
.
setMaoAni
(
"
wrong
"
);
this
.
playSFX
(
"
audio_tryagain
"
).
then
(()
=>
{
this
.
playSFX
(
"
audio_tryagain
"
).
then
(()
=>
{
pg
.
view
.
visible
(
bg_tryagain
,
false
);
pg
.
view
.
visible
(
bg_tryagain
,
false
);
pg
.
view
.
visible
(
end
,
false
);
pg
.
view
.
visible
(
end
,
false
);
this
.
setMaoAni
(
"
normal
"
);
})
})
pg
.
view
.
visible
(
end
,
true
);
pg
.
view
.
visible
(
end
,
true
);
pg
.
view
.
visible
(
bg_tryagain
,
true
);
pg
.
view
.
visible
(
bg_tryagain
,
true
);
...
@@ -448,9 +450,12 @@ cc.Class({
...
@@ -448,9 +450,12 @@ cc.Class({
this
.
_playing
=
true
;
this
.
_playing
=
true
;
this
.
_tryagainCount
++
;
this
.
_tryagainCount
++
;
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
setMaoAni
(
"
begin
"
);
if
(
this
.
_tryagainCount
==
1
)
{
if
(
this
.
_tryagainCount
==
1
)
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
one
).
then
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
one
).
then
(()
=>
{
this
.
setMaoAni
(
"
normal
"
);
this
.
_playing
=
false
;
this
.
_playing
=
false
;
})
})
// this.playSFX("audio_record");
// this.playSFX("audio_record");
...
@@ -463,6 +468,7 @@ cc.Class({
...
@@ -463,6 +468,7 @@ cc.Class({
action
.
start
();
action
.
start
();
}
else
if
(
this
.
_tryagainCount
==
2
)
{
}
else
if
(
this
.
_tryagainCount
==
2
)
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
two
).
then
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
two
).
then
(()
=>
{
this
.
setMaoAni
(
"
normal
"
);
this
.
_playing
=
false
;
this
.
_playing
=
false
;
})
})
// this.playSFX("audio_record");
// this.playSFX("audio_record");
...
@@ -475,11 +481,12 @@ cc.Class({
...
@@ -475,11 +481,12 @@ cc.Class({
action
.
start
();
action
.
start
();
}
else
{
}
else
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
three
).
then
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
three
).
then
(()
=>
{
this
.
setMaoAni
(
"
normal
"
);
this
.
_playing
=
false
;
this
.
_playing
=
false
;
this
.
nextStage
();
this
.
nextStage
();
})
})
}
}
},
1000
*
1
));
},
1000
*
2
));
},
},
state5Finish
()
{
state5Finish
()
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
...
@@ -647,7 +654,9 @@ cc.Class({
...
@@ -647,7 +654,9 @@ cc.Class({
resolve
(
""
);
resolve
(
""
);
}
else
{
}
else
{
this
.
_audio_record
=
true
;
this
.
_audio_record
=
true
;
this
.
setMaoAni
(
"
begin
"
);
pg
.
audio
.
playAudioByUrl
(
this
.
_cat
.
record
).
then
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
this
.
_cat
.
record
).
then
(()
=>
{
this
.
setMaoAni
(
"
normal
"
);
this
.
_playing
=
false
;
this
.
_playing
=
false
;
resolve
(
''
);
resolve
(
''
);
})
})
...
@@ -869,6 +878,7 @@ cc.Class({
...
@@ -869,6 +878,7 @@ cc.Class({
//按钮触发,使用的方法
//按钮触发,使用的方法
onTouchRecord
()
{
onTouchRecord
()
{
if
(
this
.
_playing
)
{
if
(
this
.
_playing
)
{
this
.
setMaoAni
(
"
normal
"
)
cc
.
audioEngine
.
stopAllEffects
();
cc
.
audioEngine
.
stopAllEffects
();
}
}
this
.
playSFX
(
"
audio_btns
"
);
this
.
playSFX
(
"
audio_btns
"
);
...
...
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