Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP49
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
OP49
Commits
50ef8098
Commit
50ef8098
authored
Oct 14, 2022
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复不封情况酷猫不播放动画的问题
parent
e140c71c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
OP49.js
assets/OP49/scene/OP49.js
+24
-11
No files found.
assets/OP49/scene/OP49.js
View file @
50ef8098
import
{
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
onHomeworkFinish
,
playDragonBoneAnimation
}
from
"
../script/util
"
;
import
{
defaultData
}
from
"
../script/defaultData
"
;
import
{
itemData
}
from
"
./data
"
;
import
{
hyLoader
}
from
"
./hyLoader
"
;
...
...
@@ -408,7 +408,10 @@ cc.Class({
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
//4秒钟之后出现goodjob提示
pg
.
view
.
visible
(
end
,
true
);
pg
.
view
.
visible
(
end_success
,
true
);
this
.
playSFX
(
"
audio_goodjob
"
);
this
.
coolCatShutOut
(
"
right
"
);
this
.
playSFX
(
"
audio_goodjob
"
).
thne
(()
=>
{
this
.
coolCatShutOut
();
});
},
1000
*
0.5
));
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
this
.
nextStage
();
...
...
@@ -433,7 +436,9 @@ cc.Class({
let
btn_picture
=
pg
.
view
.
find
(
this
,
"
btn_picture
"
);
this
.
showRestartBtn
();
// 一局失败弹出tryagain,同时下方录音按钮明亮并出现提示
this
.
coolCatSpeak
()
this
.
playSFX
(
"
audio_tryagain
"
).
then
(()
=>
{
this
.
coolCatShutOut
();
pg
.
view
.
visible
(
bg_tryagain
,
false
);
pg
.
view
.
visible
(
end
,
false
);
})
...
...
@@ -443,11 +448,13 @@ cc.Class({
pg
.
view
.
visible
(
btn_record
,
true
);
pg
.
view
.
visible
(
progress
,
false
);
this
.
coolCatSpeak
()
this
.
_playing
=
true
;
this
.
_tryagainCount
++
;
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
if
(
this
.
_tryagainCount
==
1
)
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
one
).
then
(()
=>
{
this
.
coolCatShutOut
();
this
.
_playing
=
false
;
})
// this.playSFX("audio_record");
...
...
@@ -460,6 +467,7 @@ cc.Class({
action
.
start
();
}
else
if
(
this
.
_tryagainCount
==
2
)
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
two
).
then
(()
=>
{
this
.
coolCatShutOut
();
this
.
_playing
=
false
;
})
// this.playSFX("audio_record");
...
...
@@ -472,11 +480,12 @@ cc.Class({
action
.
start
();
}
else
{
pg
.
audio
.
playAudioByUrl
(
this
.
_tryagain
.
three
).
then
(()
=>
{
this
.
coolCatShutOut
();
this
.
_playing
=
false
;
this
.
nextStage
();
})
}
},
1000
*
1
));
},
1000
*
2
));
},
state5Finish
()
{
let
btn_replay
=
pg
.
view
.
find
(
this
,
"
btn_replay
"
)
...
...
@@ -1091,15 +1100,19 @@ cc.Class({
}
},
// 酷猫讲话动画
coolCatSpeak
(
aniName
=
"
begin
"
)
{
console
.
log
(
"
Play animation:
"
+
aniName
)
const
cat
=
cc
.
find
(
'
Canvas/mao_ske
'
);
playDragonBoneAnimation
(
cat
,
aniName
,
-
1
);
},
// 酷猫闭嘴
coolCatShutOut
()
{
console
.
log
(
"
Stop animaiton
"
)
const
cat
=
cc
.
find
(
'
Canvas/mao_ske
'
);
playDragonBoneAnimation
(
cat
,
'
normal
'
,
-
1
);
},
...
...
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