血条扣血特效

This commit is contained in:
2025-08-16 15:32:39 +08:00
parent 0d3f789bdc
commit 9ccd63be3c
3 changed files with 404 additions and 49 deletions

View File

@@ -22,17 +22,17 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 26 "__id__": 42
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 32 "__id__": 48
} }
], ],
"_prefab": { "_prefab": {
"__id__": 34 "__id__": 50
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -76,23 +76,83 @@
"__id__": 3 "__id__": 3
}, },
{ {
"__id__": 11 "__id__": 19
},
{
"__id__": 27
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 35
}, },
{ {
"__id__": 21 "__id__": 37
}, },
{ {
"__id__": 23 "__id__": 39
} }
], ],
"_prefab": { "_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": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -129,23 +189,23 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 2 "__id__": 3
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 4 "__id__": 5
}, },
{ {
"__id__": 6 "__id__": 7
}, },
{ {
"__id__": 8 "__id__": 9
} }
], ],
"_prefab": { "_prefab": {
"__id__": 10 "__id__": 11
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -176,6 +236,128 @@
}, },
"_id": "" "_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", "__type__": "cc.UITransform",
"_name": "", "_name": "",
@@ -186,7 +368,171 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__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": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -210,11 +556,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 3 "__id__": 19
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 7 "__id__": 23
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@@ -227,7 +573,7 @@
"a": 255 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@7beff", "__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@f96ec",
"__expectedType__": "cc.SpriteFrame" "__expectedType__": "cc.SpriteFrame"
}, },
"_type": 1, "_type": 1,
@@ -255,11 +601,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 3 "__id__": 19
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 9 "__id__": 25
}, },
"_alignFlags": 45, "_alignFlags": 45,
"_target": null, "_target": null,
@@ -294,6 +640,8 @@
"__id__": 0 "__id__": 0
}, },
"fileId": "61x78YGExIH5sbDV+PvuuK", "fileId": "61x78YGExIH5sbDV+PvuuK",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{ {
@@ -308,17 +656,17 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 12 "__id__": 28
}, },
{ {
"__id__": 14 "__id__": 30
}, },
{ {
"__id__": 16 "__id__": 32
} }
], ],
"_prefab": { "_prefab": {
"__id__": 18 "__id__": 34
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -355,11 +703,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 11 "__id__": 27
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 13 "__id__": 29
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -383,11 +731,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 11 "__id__": 27
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 15 "__id__": 31
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@@ -428,11 +776,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 11 "__id__": 27
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 17 "__id__": 33
}, },
"_alignFlags": 45, "_alignFlags": 45,
"_target": null, "_target": null,
@@ -467,6 +815,8 @@
"__id__": 0 "__id__": 0
}, },
"fileId": "c8R9MyTiNMVYI5gmckIEFe", "fileId": "c8R9MyTiNMVYI5gmckIEFe",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{ {
@@ -479,7 +829,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 20 "__id__": 36
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -507,7 +857,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 22 "__id__": 38
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@@ -552,10 +902,10 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 24 "__id__": 40
}, },
"_barSprite": { "_barSprite": {
"__id__": 6 "__id__": 22
}, },
"_mode": 0, "_mode": 0,
"_totalLength": 72, "_totalLength": 72,
@@ -576,6 +926,8 @@
"__id__": 0 "__id__": 0
}, },
"fileId": "4bGUhFXlZF/Jdkcq0HY9ai", "fileId": "4bGUhFXlZF/Jdkcq0HY9ai",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{ {
@@ -590,14 +942,14 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 43
}, },
{ {
"__id__": 29 "__id__": 45
} }
], ],
"_prefab": { "_prefab": {
"__id__": 31 "__id__": 47
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -634,11 +986,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 26 "__id__": 42
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 28 "__id__": 44
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -662,11 +1014,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 26 "__id__": 42
}, },
"_enabled": false, "_enabled": false,
"__prefab": { "__prefab": {
"__id__": 30 "__id__": 46
}, },
"_resizeMode": 2, "_resizeMode": 2,
"_layoutType": 3, "_layoutType": 3,
@@ -717,7 +1069,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 33 "__id__": 49
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",

View File

@@ -899,10 +899,10 @@
"height": 18, "height": 18,
"rawWidth": 4, "rawWidth": 4,
"rawHeight": 18, "rawHeight": 18,
"borderTop": 0, "borderTop": 9,
"borderBottom": 0, "borderBottom": 9,
"borderLeft": 0, "borderLeft": 2,
"borderRight": 0, "borderRight": 2,
"packable": true, "packable": true,
"pixelsToUnit": 100, "pixelsToUnit": 100,
"pivotX": 0.5, "pivotX": 0.5,
@@ -15619,10 +15619,10 @@
"height": 18, "height": 18,
"rawWidth": 4, "rawWidth": 4,
"rawHeight": 18, "rawHeight": 18,
"borderTop": 0, "borderTop": 9,
"borderBottom": 0, "borderBottom": 9,
"borderLeft": 0, "borderLeft": 2,
"borderRight": 0, "borderRight": 2,
"packable": true, "packable": true,
"pixelsToUnit": 100, "pixelsToUnit": 100,
"pivotX": 0.5, "pivotX": 0.5,

View File

@@ -172,6 +172,9 @@ export class HeroViewComp extends CCComp {
let hp_max=this.Attrs[BuffAttr.HP_MAX]; let hp_max=this.Attrs[BuffAttr.HP_MAX];
let hp_progress= hp/hp_max; let hp_progress= hp/hp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar).progress = hp_progress; 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; // this.node.getChildByName("top").getChildByName("hp").active = (hp == hp_max) ? false : true;
} }
do_fight_end(){ do_fight_end(){