Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_usercenter
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_usercenter
Commits
555e7f3b
Commit
555e7f3b
authored
May 19, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 异步加载
parent
fc142d9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2360 additions
and
2262 deletions
+2360
-2262
NJ_usercenter.fire
assets/NJ_usercenter/scene/NJ_usercenter.fire
+2352
-2255
NJ_usercenter.ts
assets/NJ_usercenter/scene/NJ_usercenter.ts
+5
-4
MyCocosSceneComponent.ts
assets/NJ_usercenter/script/MyCocosSceneComponent.ts
+3
-3
No files found.
assets/NJ_usercenter/scene/NJ_usercenter.fire
View file @
555e7f3b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
assets/NJ_usercenter/scene/NJ_usercenter.ts
View file @
555e7f3b
...
...
@@ -20,17 +20,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
onLoadEnd
()
{
async
onLoadEnd
()
{
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
initData
();
this
.
initView
();
this
.
initListener
();
}
_cantouch
=
null
;
initData
()
{
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
middleLayer
)
{
cc
.
sys
.
localStorage
.
setItem
(
'
token
'
,
'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywicGhvbmUiOiIxODUwMjEzOTQwNCIsInNpZ24iOiIxNzE1N2NjNS1kYTcyLTQ5N2QtYmY3OS1kY2NlYTViY2JiMjciLCJpYXQiOjE2NTI5NDc4MjQsImV4cCI6MTY1NTUzOTgyNH0.JCnCd7nPKaZNrEgUiGY8T-_9Evu8yHm89O6eLUVxvJs
'
);
}
}
initView
()
{
...
...
assets/NJ_usercenter/script/MyCocosSceneComponent.ts
View file @
555e7f3b
...
...
@@ -87,7 +87,7 @@ export class MyCocosSceneComponent extends cc.Component {
preload
()
{
const
preloadArr
=
this
.
_imageResList
.
concat
(
this
.
_audioResList
).
concat
(
this
.
_animaResList
);
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
(
err
,
data
)
=>
{
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
async
(
err
,
data
)
=>
{
if
(
window
&&
window
[
"
air
"
])
{
// window["air"].onCourseInScreen = (next) => {
...
...
@@ -95,10 +95,10 @@ export class MyCocosSceneComponent extends cc.Component {
// this.onLoadEnd();
// next();
// };
this
.
onLoadEnd
();
await
this
.
onLoadEnd
();
window
[
"
air
"
].
hideAirClassLoading
();
}
else
{
this
.
onLoadEnd
();
await
this
.
onLoadEnd
();
}
cc
.
debug
.
setDisplayStats
(
false
);
...
...
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