优化 Demo 与 Docs 效果

This commit is contained in:
SmallMain
2022-06-21 20:44:56 +08:00
parent 6e7dbcb41a
commit 830116c953
135 changed files with 31103 additions and 30505 deletions

View File

@@ -269,7 +269,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 500
"height": 460
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -774,7 +774,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-400,
-320,
0,
0,
0,
@@ -941,7 +941,7 @@
"_N$handle": {
"__id__": 16
},
"_N$progress": 0,
"_N$progress": 0.1,
"_id": ""
},
{
@@ -1536,8 +1536,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 350
"width": 500,
"height": 280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1548,8 +1548,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-360,
-500,
-250,
-460,
0,
0,
0,
@@ -2148,7 +2148,7 @@
"asset": {
"__uuid__": "e311a003-c0a1-4ff9-9983-2154de145eb7"
},
"fileId": "ecgFkFvJlGurWWPNWVEdVg",
"fileId": "037Xo+hoxFbqEfMYOGMB9p",
"sync": false
},
{
@@ -2258,7 +2258,7 @@
"asset": {
"__uuid__": "e311a003-c0a1-4ff9-9983-2154de145eb7"
},
"fileId": "78+ISOKDVKo6JuY9GLTAmm",
"fileId": "67/0VjhAhKZqCjSyssYje9",
"sync": false
},
{
@@ -2450,7 +2450,7 @@
"_layoutSize": {
"__type__": "cc.Size",
"width": 960,
"height": 500
"height": 460
},
"_resize": 1,
"_N$layoutType": 2,
@@ -2465,7 +2465,7 @@
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$spacingY": 30,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,

View File

@@ -37,6 +37,9 @@ export default class Home extends cc.Component {
this.multiRenderUpdate();
});
this.objectNumSlider.progress = 0.02;
const offset = (this.nums[1] - this.nums[0]) * this.objectNumSlider.progress;
this.num = this.nums[0] + Math.ceil(offset);
this.numUpdate();
this.multiRenderUpdate();
}
@@ -86,7 +89,7 @@ export default class Home extends cc.Component {
this.objects.addChild(node);
node.position = cc.v3(Math.floor(Math.random() * this.objects.width), Math.floor(Math.random() * this.objects.height));
cc.tween(node).by(1, { angle: 360 }).repeatForever().start();
cc.tween(node).by(3, { angle: 360 }).repeatForever().start();
}
}

View File

@@ -73,6 +73,7 @@ export default class LeftArea extends cc.Component {
]);
this.initBtns();
this.switchPage(this.map.get(this.home));
}
@@ -80,24 +81,31 @@ export default class LeftArea extends cc.Component {
for (const [node, route] of this.map) {
node.on('toggle', (toggle: cc.Toggle) => {
if (toggle.isChecked) {
const cur = ++this.tick;
this.mainArea.destroyAllChildren();
if (route) {
cc.assetManager.loadBundle(route.bundle, (err, bundle) => {
if (!err) {
bundle.load(route.path, cc.Prefab, (err, prefab: cc.Prefab) => {
if (!err && cur === this.tick) {
this.mainArea.addChild(cc.instantiate(prefab));
}
});
}
});
}
this.switchPage(route);
}
});
}
}
switchPage(route: { bundle: string, path: string }) {
const cur = ++this.tick;
this.mainArea.destroyAllChildren();
if (route) {
cc.assetManager.loadBundle('common', () => {
cc.assetManager.loadBundle(route.bundle, (err, bundle) => {
if (!err) {
bundle.load(route.path, cc.Prefab, (err, prefab: cc.Prefab) => {
if (!err && cur === this.tick) {
this.mainArea.addChild(cc.instantiate(prefab));
}
});
}
});
});
}
}
}

View File

@@ -75,7 +75,7 @@
"__id__": 5
},
{
"__id__": 131
"__id__": 129
},
{
"__id__": 127
@@ -83,14 +83,14 @@
],
"_active": true,
"_components": [
{
"__id__": 132
},
{
"__id__": 133
},
{
"__id__": 134
},
{
"__id__": 135
},
{
"__id__": 136
}
],
"_prefab": null,
@@ -5785,15 +5785,11 @@
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 128
}
],
"_children": [],
"_active": true,
"_components": [
{
"__id__": 130
"__id__": 128
}
],
"_prefab": null,
@@ -5844,52 +5840,6 @@
"groupIndex": 0,
"_id": "54WBhHVtBF4JdadFee+PuD"
},
{
"__type__": "cc.Node",
"_objFlags": 0,
"_parent": {
"__id__": 127
},
"_prefab": {
"__id__": 129
},
"_name": "home",
"_active": true,
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "9bjPL9ujxDVaL1G8cLa042"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 128
},
"asset": {
"__uuid__": "e311a003-c0a1-4ff9-9983-2154de145eb7"
},
"fileId": "",
"sync": true
},
{
"__type__": "cc.Widget",
"_name": "",
@@ -5928,10 +5878,10 @@
"_active": true,
"_components": [
{
"__id__": 132
"__id__": 130
},
{
"__id__": 133
"__id__": 131
}
],
"_prefab": null,
@@ -5987,7 +5937,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 131
"__id__": 129
},
"_enabled": true,
"_materials": [
@@ -6021,7 +5971,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 131
"__id__": 129
},
"_enabled": true,
"alignMode": 1,