Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_NJ_lite
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
middleLayer_for_NJ_lite
Commits
a0c9979c
Commit
a0c9979c
authored
Nov 06, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
真.进度条
parent
54efb15a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1022 additions
and
913 deletions
+1022
-913
middleLayer_for_NJ_lite.fire
...iddleLayer_for_NJ_lite/scene/middleLayer_for_NJ_lite.fire
+995
-897
middleLayer.ts
assets/middleLayer_for_NJ_lite/script/middleLayer.ts
+7
-15
middleLayerBase.ts
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
+20
-1
No files found.
assets/middleLayer_for_NJ_lite/scene/middleLayer_for_NJ_lite.fire
View file @
a0c9979c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
assets/middleLayer_for_NJ_lite/script/middleLayer.ts
View file @
a0c9979c
...
@@ -861,35 +861,27 @@ export default class NewClass extends middleLayerBase {
...
@@ -861,35 +861,27 @@ export default class NewClass extends middleLayerBase {
}
}
this
.
isShowWaiting
=
true
;
this
.
isShowWaiting
=
true
;
// 隐藏加载页
const
laodingLayer
=
cc
.
find
(
'
middleLayer/loadingLayer
'
);
const
laodingLayer
=
cc
.
find
(
'
middleLayer/loadingLayer
'
);
laodingLayer
.
active
=
true
;
laodingLayer
.
active
=
true
;
const
loading
=
cc
.
find
(
'
middleLayer/loadingLayer/loading
'
);
// 跳小兔子
const
loading
=
cc
.
find
(
'
middleLayer/loadingLayer/loading
'
);
const
anim
=
loading
.
getComponent
(
cc
.
Animation
)
const
anim
=
loading
.
getComponent
(
cc
.
Animation
)
anim
.
play
(
'
loading
'
)
anim
.
play
(
'
loading
'
)
// 重置进度条
const
script
=
cc
.
find
(
'
middleLayer/loadingLayer/progress
'
).
getComponent
(
'
progressScript
'
);
const
script
=
cc
.
find
(
'
middleLayer/loadingLayer/progress
'
).
getComponent
(
'
progressScript
'
);
script
.
setProgress
(
0
);
script
.
setProgress
(
0
);
const
changeObj
=
{
value
:
0
};
// 清零进度
this
.
showWaitingIntervalId
=
setInterval
(()
=>
{
const
progressTextCom
=
cc
.
find
(
"
middleLayer/loadingLayer/pText
"
).
getComponent
(
cc
.
Label
)
script
.
setProgress
(
changeObj
.
value
);
progressTextCom
.
string
=
"
0%
"
},
1
);
cc
.
tween
(
changeObj
)
.
to
(
5
,
{
value
:
0.9
})
.
call
(()
=>
{
clearInterval
(
this
.
showWaitingIntervalId
);
})
.
start
();
}
}
hideWaitingLetters
()
{
hideWaitingLetters
()
{
cc
.
find
(
'
middleLayer/loadingLayer
'
).
active
=
false
;
cc
.
find
(
'
middleLayer/loadingLayer
'
).
active
=
false
;
this
.
isShowWaiting
=
false
;
this
.
isShowWaiting
=
false
;
if
(
this
.
showWaitingIntervalId
)
{
clearInterval
(
this
.
showWaitingIntervalId
);
}
}
}
data
:
any
=
{};
data
:
any
=
{};
...
...
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
View file @
a0c9979c
...
@@ -236,7 +236,11 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -236,7 +236,11 @@ export abstract class middleLayerBase extends cc.Component {
}
}
cc
.
assetManager
.
loadBundle
(
bondleUrl
,
{
version
:
version
},
async
(
err
,
bundle
)
=>
{
cc
.
assetManager
.
loadBundle
(
bondleUrl
,
{
version
:
version
},
async
(
err
,
bundle
)
=>
{
bundle
.
loadScene
(
sceneName
,
null
,
null
,
(
err
,
scene
)
=>
{
bundle
.
loadScene
(
sceneName
,
null
,
(
finish
,
total
,
item
)
=>
{
this
.
setLoadingProgressBar
(
Math
.
floor
(
finish
/
total
*
100
));
},
(
err
,
scene
)
=>
{
this
.
loadBundleLock
=
false
;
// 加载完成 解锁
this
.
loadBundleLock
=
false
;
// 加载完成 解锁
this
.
courseOpenTimeStamp
=
Date
.
now
();
this
.
courseOpenTimeStamp
=
Date
.
now
();
...
@@ -270,6 +274,21 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -270,6 +274,21 @@ export abstract class middleLayerBase extends cc.Component {
});
});
}
}
progressTextCom
=
null
;
progressBarScript
=
null
;
setLoadingProgressBar
(
pInt
)
{
if
(
!
this
.
progressTextCom
)
{
this
.
progressTextCom
=
cc
.
find
(
"
middleLayer/loadingLayer/pText
"
).
getComponent
(
cc
.
Label
)
}
if
(
!
this
.
progressBarScript
)
{
this
.
progressBarScript
=
cc
.
find
(
'
middleLayer/loadingLayer/progress
'
).
getComponent
(
'
progressScript
'
);
}
this
.
progressTextCom
.
string
=
`
${
pInt
}
%`
;
this
.
progressBarScript
.
setProgress
(
pInt
/
100
);
}
setNodeListVisible
()
{
setNodeListVisible
()
{
const
setParentVisible
=
(
n
)
=>
{
const
setParentVisible
=
(
n
)
=>
{
n
.
active
=
true
;
n
.
active
=
true
;
...
...
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