Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_kyxq
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_kyxq
Commits
be973413
Commit
be973413
authored
Nov 08, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加真实进度条
parent
39d457e9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
144 additions
and
50 deletions
+144
-50
middleLayer_for_kyxq.fire
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
+127
-29
middleLayerBase.ts
assets/middleLayer_for_kyxq/script/middleLayerBase.ts
+16
-1
progress.ts
assets/middleLayer_for_kyxq/script/progress.ts
+1
-20
No files found.
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
View file @
be973413
...
@@ -320,22 +320,22 @@
...
@@ -320,22 +320,22 @@
"__id__": 998
"__id__": 998
},
},
{
{
"__id__": 101
5
"__id__": 101
7
},
},
{
{
"__id__": 288
"__id__": 288
},
},
{
{
"__id__": 102
2
"__id__": 102
4
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
28
"__id__": 10
30
},
},
{
{
"__id__": 10
29
"__id__": 10
31
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -44723,18 +44723,21 @@
...
@@ -44723,18 +44723,21 @@
},
},
{
{
"__id__": 1007
"__id__": 1007
},
{
"__id__": 1012
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 101
2
"__id__": 101
4
},
},
{
{
"__id__": 101
3
"__id__": 101
5
},
},
{
{
"__id__": 101
4
"__id__": 101
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -45345,6 +45348,101 @@
...
@@ -45345,6 +45348,101 @@
},
},
"_id": "8f9YpoyVdH74RARY/UyCO/"
"_id": "8f9YpoyVdH74RARY/UyCO/"
},
},
{
"__type__": "cc.Node",
"_name": "progressText",
"_objFlags": 0,
"_parent": {
"__id__": 998
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1013
}
],
"_prefab": null,
"_opacity": 125,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80.06,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
60,
-340,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d9hNBAgSRGfr1ogufFGX8g"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1012
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "12%",
"_N$string": "12%",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "dcyYmuY1pMzZ/7iCj3gRAO"
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
"_name": "",
"_name": "",
...
@@ -45423,13 +45521,13 @@
...
@@ -45423,13 +45521,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 101
6
"__id__": 101
8
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 102
1
"__id__": 102
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -45485,20 +45583,20 @@
...
@@ -45485,20 +45583,20 @@
"_name": "tips",
"_name": "tips",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 101
5
"__id__": 101
7
},
},
"_children": [
"_children": [
{
{
"__id__": 101
7
"__id__": 101
9
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
19
"__id__": 10
21
},
},
{
{
"__id__": 102
0
"__id__": 102
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -45554,13 +45652,13 @@
...
@@ -45554,13 +45652,13 @@
"_name": "label",
"_name": "label",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 101
6
"__id__": 101
8
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
18
"__id__": 10
20
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -45616,7 +45714,7 @@
...
@@ -45616,7 +45714,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 101
7
"__id__": 101
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -45649,7 +45747,7 @@
...
@@ -45649,7 +45747,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 101
6
"__id__": 101
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -45681,7 +45779,7 @@
...
@@ -45681,7 +45779,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 101
6
"__id__": 101
8
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -45708,7 +45806,7 @@
...
@@ -45708,7 +45806,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 101
5
"__id__": 101
7
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -45739,16 +45837,16 @@
...
@@ -45739,16 +45837,16 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 102
3
"__id__": 102
5
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 102
6
"__id__": 102
8
},
},
{
{
"__id__": 102
7
"__id__": 102
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -45804,16 +45902,16 @@
...
@@ -45804,16 +45902,16 @@
"_name": "bg",
"_name": "bg",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 102
2
"__id__": 102
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 102
4
"__id__": 102
6
},
},
{
{
"__id__": 102
5
"__id__": 102
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -45869,7 +45967,7 @@
...
@@ -45869,7 +45967,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 102
3
"__id__": 102
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -45901,7 +45999,7 @@
...
@@ -45901,7 +45999,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 102
3
"__id__": 102
5
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -45928,7 +46026,7 @@
...
@@ -45928,7 +46026,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 102
2
"__id__": 102
4
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -45955,7 +46053,7 @@
...
@@ -45955,7 +46053,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 102
2
"__id__": 102
4
},
},
"_enabled": true,
"_enabled": true,
"_id": "99TmKuadlDrpqTImwqqu6G"
"_id": "99TmKuadlDrpqTImwqqu6G"
...
...
assets/middleLayer_for_kyxq/script/middleLayerBase.ts
View file @
be973413
...
@@ -205,7 +205,9 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -205,7 +205,9 @@ 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
.
courseOpenTimeStamp
=
Date
.
now
();
this
.
courseOpenTimeStamp
=
Date
.
now
();
cc
.
director
.
runScene
(
scene
,
null
,
()
=>
{
cc
.
director
.
runScene
(
scene
,
null
,
()
=>
{
...
@@ -241,6 +243,19 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -241,6 +243,19 @@ export abstract class middleLayerBase extends cc.Component {
});
});
}
}
progressTextCom
=
null
;
progressBarScript
=
null
;
setLoadingProgressBar
(
pInt
)
{
if
(
!
this
.
progressTextCom
)
{
this
.
progressTextCom
=
cc
.
find
(
"
middleLayer/loadingLayer/progressText
"
).
getComponent
(
cc
.
Label
)
}
if
(
!
this
.
progressBarScript
)
{
this
.
progressBarScript
=
cc
.
find
(
'
middleLayer/loadingLayer/prograss
'
).
getComponent
(
'
progress
'
);
}
this
.
progressTextCom
.
string
=
`
${
pInt
}
%`
;
this
.
progressBarScript
.
setProgress
(
pInt
/
100
);
}
showExitBtn
(
sceneName
)
{
showExitBtn
(
sceneName
)
{
}
}
...
...
assets/middleLayer_for_kyxq/script/progress.ts
View file @
be973413
...
@@ -23,8 +23,6 @@ export default class NewClass extends cc.Component {
...
@@ -23,8 +23,6 @@ export default class NewClass extends cc.Component {
barBaseW
=
null
;
barBaseW
=
null
;
barSpr
=
null
;
barSpr
=
null
;
barSf
=
null
;
barSf
=
null
;
timeLen
=
5000
;
// 五秒
stmt
=
null
;
init
()
{
init
()
{
this
.
barBaseW
=
this
.
bar
.
width
;
this
.
barBaseW
=
this
.
bar
.
width
;
this
.
barSpr
=
this
.
bar
.
getComponent
(
cc
.
Sprite
);
this
.
barSpr
=
this
.
bar
.
getComponent
(
cc
.
Sprite
);
...
@@ -45,23 +43,6 @@ export default class NewClass extends cc.Component {
...
@@ -45,23 +43,6 @@ export default class NewClass extends cc.Component {
}
}
onEnable
()
{
onEnable
()
{
if
(
Date
.
now
()
-
this
.
disStmt
>
1000
)
{
// 防止连续两次 enable
this
.
setProgress
(
0
);
this
.
setProgress
(
0
);
this
.
stmt
=
Date
.
now
();
}
}
}
disStmt
=
null
;
onDisable
()
{
this
.
disStmt
=
Date
.
now
();
}
update
()
{
if
(
this
.
stmt
)
{
const
pencent
=
(
Date
.
now
()
-
this
.
stmt
)
/
5000
*
0.9
;
this
.
setProgress
(
pencent
>
0.9
?
0.9
:
pencent
);
}
}
}
}
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