diff --git a/assets/resources/gui/element/hnode.prefab b/assets/resources/gui/element/hnode.prefab index 45bfd6f2..3838e0bc 100644 --- a/assets/resources/gui/element/hnode.prefab +++ b/assets/resources/gui/element/hnode.prefab @@ -25,29 +25,29 @@ "__id__": 10 }, { - "__id__": 21 + "__id__": 23 }, { - "__id__": 49 + "__id__": 51 }, { - "__id__": 77 + "__id__": 79 }, { - "__id__": 101 + "__id__": 105 } ], "_active": true, "_components": [ { - "__id__": 116 + "__id__": 122 }, { - "__id__": 118 + "__id__": 124 } ], "_prefab": { - "__id__": 120 + "__id__": 126 }, "_lpos": { "__type__": "cc.Vec3", @@ -278,14 +278,17 @@ }, { "__id__": 17 + }, + { + "__id__": 20 } ], "_prefab": { - "__id__": 20 + "__id__": 22 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": 55, "y": 37.492, "z": 0 }, @@ -481,6 +484,42 @@ "handler": "onOpenIBox", "customEventData": "" }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": { + "__id__": 21 + }, + "_alignFlags": 8, + "_target": null, + "_left": -10, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "c3BPz0lxRBxKRXvW7rk4rn" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -504,33 +543,33 @@ }, "_children": [ { - "__id__": 22 + "__id__": 24 }, { - "__id__": 30 + "__id__": 32 }, { - "__id__": 36 + "__id__": 38 } ], "_active": true, "_components": [ - { - "__id__": 42 - }, { "__id__": 44 }, { "__id__": 46 + }, + { + "__id__": 48 } ], "_prefab": { - "__id__": 48 + "__id__": 50 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": 55, "y": -30, "z": 0 }, @@ -563,23 +602,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 21 + "__id__": 23 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 23 - }, { "__id__": 25 }, { "__id__": 27 + }, + { + "__id__": 29 } ], "_prefab": { - "__id__": 29 + "__id__": 31 }, "_lpos": { "__type__": "cc.Vec3", @@ -616,11 +655,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 22 + "__id__": 24 }, "_enabled": true, "__prefab": { - "__id__": 24 + "__id__": 26 }, "_contentSize": { "__type__": "cc.Size", @@ -644,11 +683,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 22 + "__id__": 24 }, "_enabled": true, "__prefab": { - "__id__": 26 + "__id__": 28 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -689,11 +728,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 22 + "__id__": 24 }, "_enabled": true, "__prefab": { - "__id__": 28 + "__id__": 30 }, "_alignFlags": 45, "_target": null, @@ -738,20 +777,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 21 + "__id__": 23 }, "_children": [], "_active": true, "_components": [ { - "__id__": 31 + "__id__": 33 }, { - "__id__": 33 + "__id__": 35 } ], "_prefab": { - "__id__": 35 + "__id__": 37 }, "_lpos": { "__type__": "cc.Vec3", @@ -788,11 +827,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 30 + "__id__": 32 }, "_enabled": true, "__prefab": { - "__id__": 32 + "__id__": 34 }, "_contentSize": { "__type__": "cc.Size", @@ -816,11 +855,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 30 + "__id__": 32 }, "_enabled": true, "__prefab": { - "__id__": 34 + "__id__": 36 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -874,20 +913,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 21 + "__id__": 23 }, "_children": [], "_active": true, "_components": [ { - "__id__": 37 + "__id__": 39 }, { - "__id__": 39 + "__id__": 41 } ], "_prefab": { - "__id__": 41 + "__id__": 43 }, "_lpos": { "__type__": "cc.Vec3", @@ -924,11 +963,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 36 + "__id__": 38 }, "_enabled": true, "__prefab": { - "__id__": 38 + "__id__": 40 }, "_contentSize": { "__type__": "cc.Size", @@ -952,11 +991,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 36 + "__id__": 38 }, "_enabled": true, "__prefab": { - "__id__": 40 + "__id__": 42 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1033,11 +1072,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 23 }, "_enabled": true, "__prefab": { - "__id__": 43 + "__id__": 45 }, "_contentSize": { "__type__": "cc.Size", @@ -1061,11 +1100,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 23 }, "_enabled": false, "__prefab": { - "__id__": 45 + "__id__": 47 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1106,16 +1145,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 23 }, "_enabled": true, "__prefab": { - "__id__": 47 + "__id__": 49 }, - "_alignFlags": 44, + "_alignFlags": 12, "_target": null, "_left": 0, - "_right": 0, + "_right": 10, "_top": 0, "_bottom": 35, "_horizontalCenter": 0, @@ -1159,33 +1198,33 @@ }, "_children": [ { - "__id__": 50 + "__id__": 52 }, { - "__id__": 58 + "__id__": 60 }, { - "__id__": 64 + "__id__": 66 } ], "_active": true, "_components": [ - { - "__id__": 70 - }, { "__id__": 72 }, { "__id__": 74 + }, + { + "__id__": 76 } ], "_prefab": { - "__id__": 76 + "__id__": 78 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": 55, "y": -57.55, "z": 0 }, @@ -1218,23 +1257,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 49 + "__id__": 51 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 51 - }, { "__id__": 53 }, { "__id__": 55 + }, + { + "__id__": 57 } ], "_prefab": { - "__id__": 57 + "__id__": 59 }, "_lpos": { "__type__": "cc.Vec3", @@ -1271,11 +1310,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 52 }, "_enabled": true, "__prefab": { - "__id__": 52 + "__id__": 54 }, "_contentSize": { "__type__": "cc.Size", @@ -1299,11 +1338,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 52 }, "_enabled": true, "__prefab": { - "__id__": 54 + "__id__": 56 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1344,11 +1383,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 52 }, "_enabled": true, "__prefab": { - "__id__": 56 + "__id__": 58 }, "_alignFlags": 45, "_target": null, @@ -1393,20 +1432,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 49 + "__id__": 51 }, "_children": [], "_active": true, "_components": [ { - "__id__": 59 + "__id__": 61 }, { - "__id__": 61 + "__id__": 63 } ], "_prefab": { - "__id__": 63 + "__id__": 65 }, "_lpos": { "__type__": "cc.Vec3", @@ -1443,11 +1482,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 58 + "__id__": 60 }, "_enabled": true, "__prefab": { - "__id__": 60 + "__id__": 62 }, "_contentSize": { "__type__": "cc.Size", @@ -1471,11 +1510,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 58 + "__id__": 60 }, "_enabled": true, "__prefab": { - "__id__": 62 + "__id__": 64 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1529,20 +1568,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 49 + "__id__": 51 }, "_children": [], "_active": true, "_components": [ { - "__id__": 65 + "__id__": 67 }, { - "__id__": 67 + "__id__": 69 } ], "_prefab": { - "__id__": 69 + "__id__": 71 }, "_lpos": { "__type__": "cc.Vec3", @@ -1579,11 +1618,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 64 + "__id__": 66 }, "_enabled": true, "__prefab": { - "__id__": 66 + "__id__": 68 }, "_contentSize": { "__type__": "cc.Size", @@ -1607,11 +1646,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 64 + "__id__": 66 }, "_enabled": true, "__prefab": { - "__id__": 68 + "__id__": 70 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1688,11 +1727,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 51 }, "_enabled": true, "__prefab": { - "__id__": 71 + "__id__": 73 }, "_contentSize": { "__type__": "cc.Size", @@ -1716,11 +1755,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 51 }, "_enabled": false, "__prefab": { - "__id__": 73 + "__id__": 75 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1761,16 +1800,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 51 }, "_enabled": true, "__prefab": { - "__id__": 75 + "__id__": 77 }, - "_alignFlags": 44, + "_alignFlags": 12, "_target": null, "_left": 0, - "_right": 0, + "_right": 10, "_top": 0, "_bottom": 0, "_horizontalCenter": 0, @@ -1814,30 +1853,33 @@ }, "_children": [ { - "__id__": 78 + "__id__": 80 }, { - "__id__": 84 + "__id__": 86 }, { - "__id__": 90 + "__id__": 92 } ], "_active": true, "_components": [ { - "__id__": 96 + "__id__": 98 }, { - "__id__": 98 + "__id__": 100 + }, + { + "__id__": 102 } ], "_prefab": { - "__id__": 100 + "__id__": 104 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": 55, "y": 82.752, "z": 0 }, @@ -1870,20 +1912,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 77 + "__id__": 79 }, "_children": [], "_active": true, "_components": [ { - "__id__": 79 + "__id__": 81 }, { - "__id__": 81 + "__id__": 83 } ], "_prefab": { - "__id__": 83 + "__id__": 85 }, "_lpos": { "__type__": "cc.Vec3", @@ -1920,11 +1962,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": { - "__id__": 80 + "__id__": 82 }, "_contentSize": { "__type__": "cc.Size", @@ -1948,11 +1990,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": { - "__id__": 82 + "__id__": 84 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2009,20 +2051,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 77 + "__id__": 79 }, "_children": [], "_active": true, "_components": [ { - "__id__": 85 + "__id__": 87 }, { - "__id__": 87 + "__id__": 89 } ], "_prefab": { - "__id__": 89 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -2059,11 +2101,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 84 + "__id__": 86 }, "_enabled": true, "__prefab": { - "__id__": 86 + "__id__": 88 }, "_contentSize": { "__type__": "cc.Size", @@ -2087,11 +2129,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 84 + "__id__": 86 }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 90 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2148,20 +2190,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 77 + "__id__": 79 }, "_children": [], "_active": true, "_components": [ { - "__id__": 91 + "__id__": 93 }, { - "__id__": 93 + "__id__": 95 } ], "_prefab": { - "__id__": 95 + "__id__": 97 }, "_lpos": { "__type__": "cc.Vec3", @@ -2198,11 +2240,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 90 + "__id__": 92 }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 94 }, "_contentSize": { "__type__": "cc.Size", @@ -2226,11 +2268,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 90 + "__id__": 92 }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 96 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2287,11 +2329,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 99 }, "_contentSize": { "__type__": "cc.Size", @@ -2315,11 +2357,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 99 + "__id__": 101 }, "_resizeMode": 1, "_layoutType": 1, @@ -2347,6 +2389,42 @@ "__type__": "cc.CompPrefabInfo", "fileId": "83qqT1czJIz5ggb97hKUGL" }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 79 + }, + "_enabled": true, + "__prefab": { + "__id__": 103 + }, + "_alignFlags": 8, + "_target": null, + "_left": 5.5, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "5f8N6fZclEEadrzXN0WND8" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -2370,27 +2448,30 @@ }, "_children": [ { - "__id__": 102 + "__id__": 106 } ], "_active": true, "_components": [ - { - "__id__": 108 - }, - { - "__id__": 110 - }, { "__id__": 112 + }, + { + "__id__": 114 + }, + { + "__id__": 116 + }, + { + "__id__": 119 } ], "_prefab": { - "__id__": 115 + "__id__": 121 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": 55, "y": -95.647, "z": 0 }, @@ -2423,20 +2504,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 101 + "__id__": 105 }, "_children": [], "_active": true, "_components": [ { - "__id__": 103 + "__id__": 107 }, { - "__id__": 105 + "__id__": 109 } ], "_prefab": { - "__id__": 107 + "__id__": 111 }, "_lpos": { "__type__": "cc.Vec3", @@ -2473,11 +2554,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 102 + "__id__": 106 }, "_enabled": true, "__prefab": { - "__id__": 104 + "__id__": 108 }, "_contentSize": { "__type__": "cc.Size", @@ -2501,11 +2582,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 102 + "__id__": 106 }, "_enabled": true, "__prefab": { - "__id__": 106 + "__id__": 110 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2582,11 +2663,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 101 + "__id__": 105 }, "_enabled": true, "__prefab": { - "__id__": 109 + "__id__": 113 }, "_contentSize": { "__type__": "cc.Size", @@ -2610,11 +2691,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 101 + "__id__": 105 }, "_enabled": true, "__prefab": { - "__id__": 111 + "__id__": 115 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2658,15 +2739,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 101 + "__id__": 105 }, "_enabled": true, "__prefab": { - "__id__": 113 + "__id__": 117 }, "clickEvents": [ { - "__id__": 114 + "__id__": 118 } ], "_interactable": true, @@ -2718,7 +2799,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 101 + "__id__": 105 }, "_id": "" }, @@ -2736,6 +2817,42 @@ "handler": "onSellHero", "customEventData": "" }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 105 + }, + "_enabled": true, + "__prefab": { + "__id__": 120 + }, + "_alignFlags": 8, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "6bdxa82p5HPqhKb3e5YPRm" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -2759,7 +2876,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 117 + "__id__": 123 }, "_contentSize": { "__type__": "cc.Size", @@ -2768,7 +2885,7 @@ }, "_anchorPoint": { "__type__": "cc.Vec2", - "x": 0.5, + "x": 0, "y": 0.5 }, "_id": "" @@ -2787,7 +2904,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 119 + "__id__": 125 }, "icon_node": { "__id__": 10 diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index a28d7ec5..67d47f4d 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -1290,7 +1290,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": -350, "y": 93.364, "z": 0 }, @@ -1345,7 +1345,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "98sPdmBuhC94DR6vInBaLY", + "fileId": "b5euhUHTJKy51uYq8GiAyM", "prefabRootNode": { "__id__": 1 }, @@ -1393,7 +1393,7 @@ ], "value": { "__type__": "cc.Vec3", - "x": -290, + "x": 0, "y": 0, "z": 0 } @@ -1448,7 +1448,7 @@ }, "_anchorPoint": { "__type__": "cc.Vec2", - "x": 0.5, + "x": 0, "y": 0.5 }, "_id": "" @@ -1501,7 +1501,7 @@ "node": { "__id__": 49 }, - "_enabled": true, + "_enabled": false, "__prefab": { "__id__": 63 }, diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index fd3a45e1..9cbfce32 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -12,6 +12,7 @@ import { smc } from "../common/SingletonModuleComp"; import { HeroInfo, HType } from "../common/config/heroSet"; import { HeroViewComp } from "../hero/HeroViewComp"; import { FacSet } from "../common/config/GameSet"; +import { MoveComp } from "../hero/MoveComp"; const { ccclass, property } = _decorator; @@ -60,7 +61,8 @@ export class MissionCardComp extends CCComp { private cardComps: CardComp[] = []; /** 当前卡池等级(仅影响抽卡来源,不直接改卡槽现有内容) */ private poolLv: number = CARD_POOL_INIT_LEVEL; - private readonly heroInfoItemGap: number = 86; + private readonly heroInfoItemGap: number = 110; + private readonly heroInfoItemSpacing: number = 10; private heroInfoSyncTimer: number = 0; private hasCachedCardsBaseScale: boolean = false; private cardsBaseScale: Vec3 = new Vec3(1, 1, 1); @@ -613,9 +615,7 @@ export class MissionCardComp extends CCComp { for (let i = 0; i < removeKeys.length; i++) { this.heroInfoItems.delete(removeKeys[i]); } - if (removeKeys.length > 0) { - this.relayoutHeroInfoPanels(); - } + this.relayoutHeroInfoPanels(); this.updateHeroNumUI(false, false); } @@ -628,13 +628,30 @@ export class MissionCardComp extends CCComp { } private relayoutHeroInfoPanels() { - let index = 0; - this.heroInfoItems.forEach(item => { - if (!item.node || !item.node.isValid) return; - const pos = item.node.position; - item.node.setPosition(pos.x, -index * this.heroInfoItemGap, pos.z); - index += 1; + const sortedItems = [...this.heroInfoItems.values()].sort((a, b) => { + const aEnt = (a.model as any)?.ent as ecs.Entity | undefined; + const bEnt = (b.model as any)?.ent as ecs.Entity | undefined; + const aView = aEnt?.get(HeroViewComp); + const bView = bEnt?.get(HeroViewComp); + const aMove = aEnt?.get(MoveComp); + const bMove = bEnt?.get(MoveComp); + const aFrontScore = aView?.node?.position?.x ?? -999999; + const bFrontScore = bView?.node?.position?.x ?? -999999; + if (aFrontScore !== bFrontScore) return aFrontScore - bFrontScore; + const aSpawnOrder = aMove?.spawnOrder ?? 0; + const bSpawnOrder = bMove?.spawnOrder ?? 0; + if (aSpawnOrder !== bSpawnOrder) return aSpawnOrder - bSpawnOrder; + const aEid = aEnt?.eid ?? 0; + const bEid = bEnt?.eid ?? 0; + return aEid - bEid; }); + for (let index = 0; index < sortedItems.length; index++) { + const item = sortedItems[index]; + if (!item.node || !item.node.isValid) continue; + const pos = item.node.position; + item.node.setPosition(index * (this.heroInfoItemGap + this.heroInfoItemSpacing), pos.y, pos.z); + item.node.setSiblingIndex(index); + } } private clearHeroInfoPanels() {