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
e0159138
Commit
e0159138
authored
Sep 16, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fa385dae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
6 deletions
+30
-6
bgm.mp3
assets/sn04_classify/audios/bgm.mp3
+0
-0
bgm.mp3.meta
assets/sn04_classify/audios/bgm.mp3.meta
+7
-0
count_sn04_classify.mp3
assets/sn04_classify/audios/count_sn04_classify.mp3
+0
-0
count_sn04_classify.mp3.meta
assets/sn04_classify/audios/count_sn04_classify.mp3.meta
+1
-1
sn04_classify.ts
assets/sn04_classify/scene/sn04_classify.ts
+22
-5
No files found.
assets/sn04_classify/audios/bgm.mp3
0 → 100644
View file @
e0159138
File added
assets/sn04_classify/audios/bgm.mp3.meta
0 → 100644
View file @
e0159138
{
"ver": "2.0.1",
"uuid": "4f07dbcf-4a58-4d34-a598-a86b0b06712d",
"downloadMode": 0,
"duration": 29.962449,
"subMetas": {}
}
\ No newline at end of file
assets/sn04_classify/audios/count_sn04_classify.mp3
View file @
e0159138
No preview for this file type
assets/sn04_classify/audios/count_sn04_classify.mp3.meta
View file @
e0159138
...
...
@@ -2,6 +2,6 @@
"ver": "2.0.1",
"uuid": "d2584e3d-ee16-4da1-a5a4-66b3ecd5bb2a",
"downloadMode": 0,
"duration":
9.833563
,
"duration":
4.032
,
"subMetas": {}
}
\ No newline at end of file
assets/sn04_classify/scene/sn04_classify.ts
View file @
e0159138
...
...
@@ -67,6 +67,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
initData
();
this
.
initView
();
this
.
initEvent
();
this
.
playLocalBgmAudio
();
}
protected
onDestroy
():
void
{
pg
.
event
.
clear
();
...
...
@@ -165,13 +166,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
ques
=
Game
.
getIns
().
getList
();
ques
.
forEach
((
q
)
=>
{
if
(
q
.
type
==
"
img
"
)
{
if
(
q
.
type
==
"
img
"
)
{
let
itemBox
=
cc
.
instantiate
(
this
.
card_boximg
);
itemBox
.
parent
=
this
.
layout_box
;
pg
.
view
.
setNetImg
(
cc
.
find
(
"
img
"
,
itemBox
),
q
.
image
,
{
w
:
190
,
h
:
140
});
pg
.
view
.
setNetImg
(
cc
.
find
(
"
img
"
,
itemBox
),
q
.
image
,
{
w
:
190
,
h
:
140
});
itemBox
.
data
=
q
;
this
.
wordItams
.
push
(
itemBox
);
}
else
{
}
else
{
let
itemBox
=
cc
.
instantiate
(
this
.
card_box
);
itemBox
.
parent
=
this
.
layout_box
;
cc
.
find
(
"
desc
"
,
itemBox
).
getComponent
(
cc
.
Label
).
string
=
q
.
text
;
...
...
@@ -405,7 +406,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
gameOver
();
return
;
}
if
(
this
.
gameCount
<
9
&&
this
.
playCount
)
{
if
(
this
.
gameCount
<
3
&&
this
.
playCount
)
{
this
.
playCount
=
false
;
this
.
playLocalAudio
(
"
count
"
).
then
(()
=>
{
this
.
playCount
=
true
;
...
...
@@ -447,12 +448,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
playLocalAudio
(
audioName
)
{
let
noStop
=
audioName
==
"
count
"
;
if
(
!
noStop
)
this
.
stopBgmAdudio
();
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
return
new
Promise
((
resolve
,
reject
)
=>
{
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
});
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
if
(
!
noStop
)
this
.
resumeBgmMusic
();
});
})
}
private
bgmId
;
playLocalBgmAudio
(
audioName
=
"
bgm
"
)
{
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
bgmId
=
cc
.
audioEngine
.
playMusic
(
audio
.
clip
,
true
);
cc
.
audioEngine
.
setFinishCallback
(
this
.
bgmId
,
()
=>
{
resolve
(
this
.
bgmId
);
});
})
}
stopBgmAdudio
()
{
cc
.
audioEngine
.
pauseMusic
();
}
resumeBgmMusic
()
{
cc
.
audioEngine
.
resumeMusic
();
}
async
showOneFirework
(
pos
,
parentNode
,
nodeList
)
{
...
...
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