Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_game_select
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
NJ_game_select
Commits
428c3602
Commit
428c3602
authored
May 25, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
parent
ed4ae492
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
NJ_game_select.ts
assets/NJ_game_select/scene/NJ_game_select.ts
+14
-5
MyCocosSceneComponent.ts
assets/NJ_game_select/script/MyCocosSceneComponent.ts
+4
-4
No files found.
assets/NJ_game_select/scene/NJ_game_select.ts
View file @
428c3602
...
...
@@ -7,11 +7,18 @@ const { ccclass, property } = cc._decorator;
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
addPreloadImage
()
{
this
.
_imageResList
.
push
({
url
:
this
.
data
.
havePic
});
this
.
data
.
pageArr
.
forEach
(
page
=>
{
this
.
_imageResList
.
push
({
url
:
page
.
bgItem
.
url
});
this
.
_imageResList
.
push
({
url
:
page
.
startBg
});
});
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
this
.
_imageResList
.
push
({
url
:
this
.
data
.
havePic
});
this
.
data
.
pageArr
.
forEach
(
page
=>
{
this
.
_imageResList
.
push
({
url
:
page
.
bgItem
.
url
});
this
.
_imageResList
.
push
({
url
:
page
.
startBg
});
});
const
bgNode
=
cc
.
find
(
'
Canvas/bg
'
);
bgNode
.
color
=
cc
.
color
(
255
,
255
,
255
);
const
startBg
=
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
startBg
;
this
.
setNodeSpirteFrameByUrl
(
startBg
,
bgNode
,
resolve
);
})
}
async
onLoadEnd
()
{
...
...
@@ -20,6 +27,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
initListener
();
await
this
.
startStep1
();
this
.
updateView
();
await
this
.
startStep2
();
}
...
...
@@ -32,6 +40,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
await
this
.
asyncCountDown
(
progress
,
3
);
await
asyncDelay
(
0.3
);
await
this
.
checkPage
();
this
.
step
=
1
;
}
async
startStep2
()
{
await
this
.
asyncPlayAudioByUrl
(
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
hotZoneItemArr
[
this
.
currentPartIdx
].
audio_url
);
...
...
assets/NJ_game_select/script/MyCocosSceneComponent.ts
View file @
428c3602
...
...
@@ -69,10 +69,10 @@ export class MyCocosSceneComponent extends cc.Component {
return
defaultData
;
}
preloadItem
()
{
this
.
addPreloadImage
();
this
.
addPreloadAudio
();
this
.
addPreloadAnima
();
async
preloadItem
()
{
await
this
.
addPreloadImage
();
await
this
.
addPreloadAudio
();
await
this
.
addPreloadAnima
();
this
.
preload
();
}
...
...
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