refactor(渲染): 重构实体层级管理方式

- 移除通过 setSiblingIndex 手动设置层级的方式
- 新增 HERO、LINE1、LINE2、SKILL 等容器节点自动管理层级
- 调整英雄、怪物、技能等实体的父节点到对应容器
- 优化提示信息的位置偏移量
This commit is contained in:
2025-11-04 14:23:07 +08:00
parent 1e0537b63d
commit 087f4010be
7 changed files with 419 additions and 59 deletions

View File

@@ -28,17 +28,17 @@
"_active": true,
"_components": [
{
"__id__": 110
"__id__": 126
},
{
"__id__": 112
"__id__": 128
},
{
"__id__": 114
"__id__": 130
}
],
"_prefab": {
"__id__": 116
"__id__": 132
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -197,17 +197,17 @@
"_active": true,
"_components": [
{
"__id__": 103
"__id__": 119
},
{
"__id__": 105
"__id__": 121
},
{
"__id__": 107
"__id__": 123
}
],
"_prefab": {
"__id__": 109
"__id__": 125
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -257,17 +257,17 @@
"__id__": 88
},
{
"__id__": 94
"__id__": 110
}
],
"_active": true,
"_components": [
{
"__id__": 100
"__id__": 116
}
],
"_prefab": {
"__id__": 102
"__id__": 118
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2023,23 +2023,83 @@
{
"__type__": "cc.Node",
"_name": "EntityLayer",
"_objFlags": 512,
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 89
},
{
"__id__": 93
},
{
"__id__": 97
},
{
"__id__": 101
}
],
"_active": true,
"_components": [
{
"__id__": 105
},
{
"__id__": 107
}
],
"_prefab": {
"__id__": 109
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "LINE1",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 88
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 89
},
{
"__id__": 91
"__id__": 90
}
],
"_prefab": {
"__id__": 93
"__id__": 92
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2070,6 +2130,311 @@
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 89
},
"_enabled": true,
"__prefab": {
"__id__": 91
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b8C5CFg5lM4oUHMeSrc/sV"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "4dcNJaDM1CLI9q3fIqHZ/U",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "HERO",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 88
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 94
}
],
"_prefab": {
"__id__": 96
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 93
},
"_enabled": true,
"__prefab": {
"__id__": 95
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "dasmpuTSVM7qA3QW9/3XjQ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "eaiasKNEFO6qvodGhL4a0b",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "LINE2",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 88
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 98
}
],
"_prefab": {
"__id__": 100
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 97
},
"_enabled": true,
"__prefab": {
"__id__": 99
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ea767WaZRHo4s0bZQfN8zP"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "60UdPtJn9ALLHCveLwT1bT",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "SKILL",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 88
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 102
}
],
"_prefab": {
"__id__": 104
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 101
},
"_enabled": true,
"__prefab": {
"__id__": 103
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "47rZJ0Uv9HkIhkIUzm2ES9"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f0bFfyrcRF77DMu5a9MYtG",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -2080,7 +2445,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 90
"__id__": 106
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2108,7 +2473,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 92
"__id__": 108
},
"_id": ""
},
@@ -2141,14 +2506,14 @@
"_active": true,
"_components": [
{
"__id__": 95
"__id__": 111
},
{
"__id__": 97
"__id__": 113
}
],
"_prefab": {
"__id__": 99
"__id__": 115
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2185,11 +2550,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 94
"__id__": 110
},
"_enabled": true,
"__prefab": {
"__id__": 96
"__id__": 112
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2213,11 +2578,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 94
"__id__": 110
},
"_enabled": true,
"__prefab": {
"__id__": 98
"__id__": 114
},
"light": null,
"_id": ""
@@ -2249,7 +2614,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 101
"__id__": 117
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2290,7 +2655,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 104
"__id__": 120
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2318,7 +2683,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 106
"__id__": 122
},
"camera": {
"__id__": 3
@@ -2333,10 +2698,10 @@
"__id__": 84
},
"entityLayer": {
"__id__": 91
"__id__": 107
},
"SkillLayer": {
"__id__": 97
"__id__": 113
},
"isFollowPlayer": true,
"_id": ""
@@ -2355,7 +2720,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 108
"__id__": 124
},
"_id": ""
},
@@ -2386,7 +2751,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 111
"__id__": 127
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2414,7 +2779,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 113
"__id__": 129
},
"_cameraComponent": {
"__id__": 3
@@ -2436,7 +2801,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 115
"__id__": 131
},
"_alignFlags": 45,
"_target": null,