From 9ccd63be3c17d03f31191dc62427af1ac5f3dfb4 Mon Sep 17 00:00:00 2001 From: panfudan Date: Sat, 16 Aug 2025 15:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=80=E6=9D=A1=E6=89=A3=E8=A1=80=E7=89=B9?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/heros/top.prefab | 434 +++++++++++++++++++++--- assets/resources/gui/ui1.plist.meta | 16 +- assets/script/game/hero/HeroViewComp.ts | 3 + 3 files changed, 404 insertions(+), 49 deletions(-) diff --git a/assets/resources/game/heros/top.prefab b/assets/resources/game/heros/top.prefab index 64215425..2bf08c72 100644 --- a/assets/resources/game/heros/top.prefab +++ b/assets/resources/game/heros/top.prefab @@ -22,17 +22,17 @@ "__id__": 2 }, { - "__id__": 26 + "__id__": 42 } ], "_active": true, "_components": [ { - "__id__": 32 + "__id__": 48 } ], "_prefab": { - "__id__": 34 + "__id__": 50 }, "_lpos": { "__type__": "cc.Vec3", @@ -76,23 +76,83 @@ "__id__": 3 }, { - "__id__": 11 + "__id__": 19 + }, + { + "__id__": 27 } ], "_active": true, "_components": [ { - "__id__": 19 + "__id__": 35 }, { - "__id__": 21 + "__id__": 37 }, { - "__id__": 23 + "__id__": 39 } ], "_prefab": { - "__id__": 25 + "__id__": 41 + }, + "_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": "hpb", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 4 + } + ], + "_active": true, + "_components": [ + { + "__id__": 12 + }, + { + "__id__": 14 + }, + { + "__id__": 16 + } + ], + "_prefab": { + "__id__": 18 }, "_lpos": { "__type__": "cc.Vec3", @@ -129,23 +189,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 2 + "__id__": 3 }, "_children": [], "_active": true, "_components": [ { - "__id__": 4 + "__id__": 5 }, { - "__id__": 6 + "__id__": 7 }, { - "__id__": 8 + "__id__": 9 } ], "_prefab": { - "__id__": 10 + "__id__": 11 }, "_lpos": { "__type__": "cc.Vec3", @@ -176,6 +236,128 @@ }, "_id": "" }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 4 + }, + "_enabled": true, + "__prefab": { + "__id__": 6 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 72, + "height": 10 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "36h3bQdkdJKbrMO0hzluT2" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 4 + }, + "_enabled": true, + "__prefab": { + "__id__": 8 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@26313", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 1, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "3fohHWYyJOa4qER0pMjNcK" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 4 + }, + "_enabled": true, + "__prefab": { + "__id__": 10 + }, + "_alignFlags": 45, + "_target": null, + "_left": 1, + "_right": 1, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 56, + "_originalHeight": 13, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7b0PF2UvtEY5x9Rgy61XUI" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "81TtjzZnRNxoGv8ZnTo+3M", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", @@ -186,7 +368,171 @@ }, "_enabled": true, "__prefab": { - "__id__": 5 + "__id__": 13 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 74, + "height": 10 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f7KOYf8SFNs6F3um5Z1q9R" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 3 + }, + "_enabled": false, + "__prefab": { + "__id__": 15 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@26313", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "4fLsgusidPMKeVMB6ftXPg" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 17 + }, + "_barSprite": { + "__id__": 7 + }, + "_mode": 0, + "_totalLength": 72, + "_progress": 1, + "_reverse": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "70HKqj1/5OhbqN1EzpdP+C" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "25gBbCmwtNapwuECHQuAYX", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "Bar", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 20 + }, + { + "__id__": 22 + }, + { + "__id__": 24 + } + ], + "_prefab": { + "__id__": 26 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -36, + "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__": 19 + }, + "_enabled": true, + "__prefab": { + "__id__": 21 }, "_contentSize": { "__type__": "cc.Size", @@ -210,11 +556,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 3 + "__id__": 19 }, "_enabled": true, "__prefab": { - "__id__": 7 + "__id__": 23 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -227,7 +573,7 @@ "a": 255 }, "_spriteFrame": { - "__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@7beff", + "__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@f96ec", "__expectedType__": "cc.SpriteFrame" }, "_type": 1, @@ -255,11 +601,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 3 + "__id__": 19 }, "_enabled": true, "__prefab": { - "__id__": 9 + "__id__": 25 }, "_alignFlags": 45, "_target": null, @@ -294,6 +640,8 @@ "__id__": 0 }, "fileId": "61x78YGExIH5sbDV+PvuuK", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -308,17 +656,17 @@ "_active": true, "_components": [ { - "__id__": 12 + "__id__": 28 }, { - "__id__": 14 + "__id__": 30 }, { - "__id__": 16 + "__id__": 32 } ], "_prefab": { - "__id__": 18 + "__id__": 34 }, "_lpos": { "__type__": "cc.Vec3", @@ -355,11 +703,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 11 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 13 + "__id__": 29 }, "_contentSize": { "__type__": "cc.Size", @@ -383,11 +731,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 11 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 15 + "__id__": 31 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -428,11 +776,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 11 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 17 + "__id__": 33 }, "_alignFlags": 45, "_target": null, @@ -467,6 +815,8 @@ "__id__": 0 }, "fileId": "c8R9MyTiNMVYI5gmckIEFe", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -479,7 +829,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 20 + "__id__": 36 }, "_contentSize": { "__type__": "cc.Size", @@ -507,7 +857,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 22 + "__id__": 38 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -552,10 +902,10 @@ }, "_enabled": true, "__prefab": { - "__id__": 24 + "__id__": 40 }, "_barSprite": { - "__id__": 6 + "__id__": 22 }, "_mode": 0, "_totalLength": 72, @@ -576,6 +926,8 @@ "__id__": 0 }, "fileId": "4bGUhFXlZF/Jdkcq0HY9ai", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -590,14 +942,14 @@ "_active": true, "_components": [ { - "__id__": 27 + "__id__": 43 }, { - "__id__": 29 + "__id__": 45 } ], "_prefab": { - "__id__": 31 + "__id__": 47 }, "_lpos": { "__type__": "cc.Vec3", @@ -634,11 +986,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 42 }, "_enabled": true, "__prefab": { - "__id__": 28 + "__id__": 44 }, "_contentSize": { "__type__": "cc.Size", @@ -662,11 +1014,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 42 }, "_enabled": false, "__prefab": { - "__id__": 30 + "__id__": 46 }, "_resizeMode": 2, "_layoutType": 3, @@ -717,7 +1069,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 33 + "__id__": 49 }, "_contentSize": { "__type__": "cc.Size", diff --git a/assets/resources/gui/ui1.plist.meta b/assets/resources/gui/ui1.plist.meta index f84739d3..6c326ee9 100644 --- a/assets/resources/gui/ui1.plist.meta +++ b/assets/resources/gui/ui1.plist.meta @@ -899,10 +899,10 @@ "height": 18, "rawWidth": 4, "rawHeight": 18, - "borderTop": 0, - "borderBottom": 0, - "borderLeft": 0, - "borderRight": 0, + "borderTop": 9, + "borderBottom": 9, + "borderLeft": 2, + "borderRight": 2, "packable": true, "pixelsToUnit": 100, "pivotX": 0.5, @@ -15619,10 +15619,10 @@ "height": 18, "rawWidth": 4, "rawHeight": 18, - "borderTop": 0, - "borderBottom": 0, - "borderLeft": 0, - "borderRight": 0, + "borderTop": 9, + "borderBottom": 9, + "borderLeft": 2, + "borderRight": 2, "packable": true, "pixelsToUnit": 100, "pivotX": 0.5, diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 678ac6bc..4e25145c 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -172,6 +172,9 @@ export class HeroViewComp extends CCComp { let hp_max=this.Attrs[BuffAttr.HP_MAX]; let hp_progress= hp/hp_max; this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar).progress = hp_progress; + this.scheduleOnce(()=>{ + this.node.getChildByName("top").getChildByName("hp").getChildByName("hpb").getComponent(ProgressBar).progress = hp_progress; + },0.15) // this.node.getChildByName("top").getChildByName("hp").active = (hp == hp_max) ? false : true; } do_fight_end(){