diff --git a/assets/resources/game/heros/top.prefab b/assets/resources/game/heros/top.prefab index e875eed5..86ba5e75 100644 --- a/assets/resources/game/heros/top.prefab +++ b/assets/resources/game/heros/top.prefab @@ -25,20 +25,20 @@ "__id__": 8 }, { - "__id__": 48 + "__id__": 32 }, { - "__id__": 88 + "__id__": 56 } ], "_active": true, "_components": [ { - "__id__": 128 + "__id__": 80 } ], "_prefab": { - "__id__": 130 + "__id__": 82 }, "_lpos": { "__type__": "cc.Vec3", @@ -200,7 +200,7 @@ }, { "__type__": "cc.Node", - "_name": "mp", + "_name": "cd", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -211,31 +211,28 @@ "__id__": 9 }, { - "__id__": 25 - }, - { - "__id__": 33 + "__id__": 17 } ], "_active": true, "_components": [ { - "__id__": 41 + "__id__": 25 }, { - "__id__": 43 + "__id__": 27 }, { - "__id__": 45 + "__id__": 29 } ], "_prefab": { - "__id__": 47 + "__id__": 31 }, "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": -8.389, + "y": -9.738, "z": 0 }, "_lrot": { @@ -263,371 +260,28 @@ }, { "__type__": "cc.Node", - "_name": "mpb", + "_name": "Bar", "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 8 }, - "_children": [ + "_children": [], + "_active": true, + "_components": [ { "__id__": 10 - } - ], - "_active": false, - "_components": [ - { - "__id__": 18 }, { - "__id__": 20 + "__id__": 12 }, { - "__id__": 22 + "__id__": 14 } ], "_prefab": { - "__id__": 24 - }, - "_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": "Bar", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 9 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 11 - }, - { - "__id__": 13 - }, - { - "__id__": 15 - } - ], - "_prefab": { - "__id__": 17 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -50, - "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__": 10 - }, - "_enabled": true, - "__prefab": { - "__id__": 12 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 10 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d1tDXru5RJFJmHWM2BmWtZ" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 10 - }, - "_enabled": true, - "__prefab": { - "__id__": 14 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@46c83", - "__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": { - "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73", - "__expectedType__": "cc.SpriteAtlas" - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "376TN2cLxAr4FXLVFBEQjY" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 10 - }, - "_enabled": true, - "__prefab": { "__id__": 16 }, - "_alignFlags": 45, - "_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": 56, - "_originalHeight": 13, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "5btO+DPUpE2JU1HqtWNoFR" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "3apDybTg1MCYP5gF/g6cQ3", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 9 - }, - "_enabled": true, - "__prefab": { - "__id__": 19 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 10 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "8dOVmN82VFkbG0FziU+OrZ" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 9 - }, - "_enabled": false, - "__prefab": { - "__id__": 21 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_spriteFrame": null, - "_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": "7cuP2l8PdDDqCTu2LZlpxt" - }, - { - "__type__": "cc.ProgressBar", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 9 - }, - "_enabled": true, - "__prefab": { - "__id__": 23 - }, - "_barSprite": { - "__id__": 13 - }, - "_mode": 0, - "_totalLength": 97, - "_progress": 1, - "_reverse": false, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "86hBt3cklPvayX3bMe2X+N" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "5czDbSPilIgKenla4t2eTH", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Bar", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 8 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 26 - }, - { - "__id__": 28 - }, - { - "__id__": 30 - } - ], - "_prefab": { - "__id__": 32 - }, "_lpos": { "__type__": "cc.Vec3", "x": -50, @@ -663,11 +317,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 25 + "__id__": 9 }, "_enabled": true, "__prefab": { - "__id__": 27 + "__id__": 11 }, "_contentSize": { "__type__": "cc.Size", @@ -691,20 +345,20 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 25 + "__id__": 9 }, "_enabled": true, "__prefab": { - "__id__": 29 + "__id__": 13 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 245, - "g": 255, - "b": 0, + "r": 241, + "g": 196, + "b": 15, "a": 255 }, "_spriteFrame": { @@ -739,11 +393,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 25 + "__id__": 9 }, "_enabled": true, "__prefab": { - "__id__": 31 + "__id__": 15 }, "_alignFlags": 45, "_target": null, @@ -791,20 +445,20 @@ "__id__": 8 }, "_children": [], - "_active": false, + "_active": true, "_components": [ { - "__id__": 34 + "__id__": 18 }, { - "__id__": 36 + "__id__": 20 }, { - "__id__": 38 + "__id__": 22 } ], "_prefab": { - "__id__": 40 + "__id__": 24 }, "_lpos": { "__type__": "cc.Vec3", @@ -841,16 +495,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 33 + "__id__": 17 }, "_enabled": true, "__prefab": { - "__id__": 35 + "__id__": 19 }, "_contentSize": { "__type__": "cc.Size", - "width": 333.33333333333337, - "height": 33.333333333333336 + "width": 340, + "height": 40 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -869,11 +523,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 33 + "__id__": 17 }, "_enabled": true, "__prefab": { - "__id__": 37 + "__id__": 21 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -917,18 +571,18 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 33 + "__id__": 17 }, "_enabled": true, "__prefab": { - "__id__": 39 + "__id__": 23 }, "_alignFlags": 45, "_target": null, - "_left": 0, - "_right": 0, - "_top": 0, - "_bottom": 0, + "_left": -1, + "_right": -1, + "_top": -1, + "_bottom": -1, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -970,7 +624,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 42 + "__id__": 26 }, "_contentSize": { "__type__": "cc.Size", @@ -996,18 +650,18 @@ "node": { "__id__": 8 }, - "_enabled": false, + "_enabled": true, "__prefab": { - "__id__": 44 + "__id__": 28 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, + "r": 44, + "g": 62, + "b": 80, "a": 255 }, "_spriteFrame": { @@ -1046,10 +700,10 @@ }, "_enabled": true, "__prefab": { - "__id__": 46 + "__id__": 30 }, "_barSprite": { - "__id__": 28 + "__id__": 12 }, "_mode": 0, "_totalLength": 100, @@ -1084,29 +738,26 @@ }, "_children": [ { - "__id__": 49 + "__id__": 33 }, { - "__id__": 65 - }, - { - "__id__": 73 + "__id__": 41 } ], "_active": true, "_components": [ { - "__id__": 81 + "__id__": 49 }, { - "__id__": 83 + "__id__": 51 }, { - "__id__": 85 + "__id__": 53 } ], "_prefab": { - "__id__": 87 + "__id__": 55 }, "_lpos": { "__type__": "cc.Vec3", @@ -1137,86 +788,29 @@ }, "_id": "" }, - { - "__type__": "cc.Node", - "_name": "hpb", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 48 - }, - "_children": [ - { - "__id__": 50 - } - ], - "_active": true, - "_components": [ - { - "__id__": 58 - }, - { - "__id__": 60 - }, - { - "__id__": 62 - } - ], - "_prefab": { - "__id__": 64 - }, - "_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": "Bar", "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 49 + "__id__": 32 }, "_children": [], "_active": true, "_components": [ { - "__id__": 51 + "__id__": 34 }, { - "__id__": 53 + "__id__": 36 }, { - "__id__": 55 + "__id__": 38 } ], "_prefab": { - "__id__": 57 + "__id__": 40 }, "_lpos": { "__type__": "cc.Vec3", @@ -1253,300 +847,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 33 }, "_enabled": true, "__prefab": { - "__id__": 52 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "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__": 50 - }, - "_enabled": true, - "__prefab": { - "__id__": 54 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@46c83", - "__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": { - "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73", - "__expectedType__": "cc.SpriteAtlas" - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "3fohHWYyJOa4qER0pMjNcK" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 50 - }, - "_enabled": true, - "__prefab": { - "__id__": 56 - }, - "_alignFlags": 45, - "_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": 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": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 49 - }, - "_enabled": true, - "__prefab": { - "__id__": 59 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "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__": 49 - }, - "_enabled": false, - "__prefab": { - "__id__": 61 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "9fd900dd-221b-4f89-8f2c-fba34243c835@f9941", - "__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__": 49 - }, - "_enabled": true, - "__prefab": { - "__id__": 63 - }, - "_barSprite": { - "__id__": 53 - }, - "_mode": 0, - "_totalLength": 100, - "_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__": 48 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 66 - }, - { - "__id__": 68 - }, - { - "__id__": 70 - } - ], - "_prefab": { - "__id__": 72 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -50, - "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__": 65 - }, - "_enabled": true, - "__prefab": { - "__id__": 67 + "__id__": 35 }, "_contentSize": { "__type__": "cc.Size", @@ -1570,11 +875,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 65 + "__id__": 33 }, "_enabled": true, "__prefab": { - "__id__": 69 + "__id__": 37 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1618,11 +923,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 65 + "__id__": 33 }, "_enabled": true, "__prefab": { - "__id__": 71 + "__id__": 39 }, "_alignFlags": 45, "_target": null, @@ -1667,23 +972,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 48 + "__id__": 32 }, "_children": [], - "_active": false, + "_active": true, "_components": [ { - "__id__": 74 + "__id__": 42 }, { - "__id__": 76 + "__id__": 44 }, { - "__id__": 78 + "__id__": 46 } ], "_prefab": { - "__id__": 80 + "__id__": 48 }, "_lpos": { "__type__": "cc.Vec3", @@ -1720,16 +1025,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 75 + "__id__": 43 }, "_contentSize": { "__type__": "cc.Size", - "width": 333.33333333333337, - "height": 33.333333333333336 + "width": 340, + "height": 40 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1748,11 +1053,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 77 + "__id__": 45 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1796,18 +1101,18 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 79 + "__id__": 47 }, "_alignFlags": 45, "_target": null, - "_left": 0, - "_right": 0, - "_top": 0, - "_bottom": 0, + "_left": -1, + "_right": -1, + "_top": -1, + "_bottom": -1, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -1845,11 +1150,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 48 + "__id__": 32 }, "_enabled": true, "__prefab": { - "__id__": 82 + "__id__": 50 }, "_contentSize": { "__type__": "cc.Size", @@ -1873,20 +1178,20 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 48 + "__id__": 32 }, "_enabled": true, "__prefab": { - "__id__": 84 + "__id__": 52 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 41, - "g": 41, - "b": 41, + "r": 44, + "g": 62, + "b": 80, "a": 255 }, "_spriteFrame": { @@ -1921,17 +1226,17 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 48 + "__id__": 32 }, "_enabled": true, "__prefab": { - "__id__": 86 + "__id__": 54 }, "_barSprite": { - "__id__": 68 + "__id__": 36 }, "_mode": 0, - "_totalLength": 98, + "_totalLength": 100, "_progress": 1, "_reverse": false, "_id": "" @@ -1963,29 +1268,26 @@ }, "_children": [ { - "__id__": 89 + "__id__": 57 }, { - "__id__": 105 - }, - { - "__id__": 113 + "__id__": 65 } ], "_active": false, "_components": [ { - "__id__": 121 + "__id__": 73 }, { - "__id__": 123 + "__id__": 75 }, { - "__id__": 125 + "__id__": 77 } ], "_prefab": { - "__id__": 127 + "__id__": 79 }, "_lpos": { "__type__": "cc.Vec3", @@ -2016,86 +1318,29 @@ }, "_id": "" }, - { - "__type__": "cc.Node", - "_name": "pb", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 88 - }, - "_children": [ - { - "__id__": 90 - } - ], - "_active": false, - "_components": [ - { - "__id__": 98 - }, - { - "__id__": 100 - }, - { - "__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.Node", "_name": "Bar", "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 89 + "__id__": 56 }, "_children": [], "_active": true, "_components": [ { - "__id__": 91 + "__id__": 58 }, { - "__id__": 93 + "__id__": 60 }, { - "__id__": 95 + "__id__": 62 } ], "_prefab": { - "__id__": 97 + "__id__": 64 }, "_lpos": { "__type__": "cc.Vec3", @@ -2132,297 +1377,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 90 + "__id__": 57 }, "_enabled": true, "__prefab": { - "__id__": 92 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 10 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "692H8vRB1Oppm8ghZwn62o" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 90 - }, - "_enabled": true, - "__prefab": { - "__id__": 94 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 66, - "g": 195, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@46c83", - "__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": { - "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73", - "__expectedType__": "cc.SpriteAtlas" - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "e0+0IQGYhAeYEfro5Ob37c" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 90 - }, - "_enabled": true, - "__prefab": { - "__id__": 96 - }, - "_alignFlags": 45, - "_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": 56, - "_originalHeight": 13, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "f84IqILN9JPoRMrZKcUNsd" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "d2hcZn71lFFLK5zIPSssUZ", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 89 - }, - "_enabled": true, - "__prefab": { - "__id__": 99 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 10 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "4fT4AG6L9FjJv8OiC0VeeE" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 89 - }, - "_enabled": false, - "__prefab": { - "__id__": 101 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_spriteFrame": null, - "_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": "64QdUc7JNNI545n3K88kVa" - }, - { - "__type__": "cc.ProgressBar", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 89 - }, - "_enabled": true, - "__prefab": { - "__id__": 103 - }, - "_barSprite": { - "__id__": 93 - }, - "_mode": 0, - "_totalLength": 100, - "_progress": 1, - "_reverse": false, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "2bcomQ4JdDKJqh4HmtHPk7" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "5eaSmW/blIhKy48yiM9yld", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Bar", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 88 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 106 - }, - { - "__id__": 108 - }, - { - "__id__": 110 - } - ], - "_prefab": { - "__id__": 112 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -50, - "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__": 105 - }, - "_enabled": true, - "__prefab": { - "__id__": 107 + "__id__": 59 }, "_contentSize": { "__type__": "cc.Size", @@ -2446,11 +1405,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 105 + "__id__": 57 }, "_enabled": true, "__prefab": { - "__id__": 109 + "__id__": 61 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2494,11 +1453,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 105 + "__id__": 57 }, "_enabled": true, "__prefab": { - "__id__": 111 + "__id__": 63 }, "_alignFlags": 45, "_target": null, @@ -2543,23 +1502,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 88 + "__id__": 56 }, "_children": [], "_active": false, "_components": [ { - "__id__": 114 + "__id__": 66 }, { - "__id__": 116 + "__id__": 68 }, { - "__id__": 118 + "__id__": 70 } ], "_prefab": { - "__id__": 120 + "__id__": 72 }, "_lpos": { "__type__": "cc.Vec3", @@ -2596,11 +1555,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 113 + "__id__": 65 }, "_enabled": true, "__prefab": { - "__id__": 115 + "__id__": 67 }, "_contentSize": { "__type__": "cc.Size", @@ -2624,11 +1583,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 113 + "__id__": 65 }, "_enabled": true, "__prefab": { - "__id__": 117 + "__id__": 69 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2672,11 +1631,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 113 + "__id__": 65 }, "_enabled": true, "__prefab": { - "__id__": 119 + "__id__": 71 }, "_alignFlags": 45, "_target": null, @@ -2721,11 +1680,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 74 }, "_contentSize": { "__type__": "cc.Size", @@ -2749,11 +1708,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 124 + "__id__": 76 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2797,14 +1756,14 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 126 + "__id__": 78 }, "_barSprite": { - "__id__": 108 + "__id__": 60 }, "_mode": 0, "_totalLength": 100, @@ -2839,7 +1798,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 129 + "__id__": 81 }, "_contentSize": { "__type__": "cc.Size", diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 4eff2b3c..343d19f4 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -1,4 +1,4 @@ -import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Tween, Color, BoxCollider2D, UITransform} from "cc"; +import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Tween, Color, BoxCollider2D, UITransform, UIOpacity} from "cc"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { mLogger } from "../common/Logger"; @@ -42,6 +42,14 @@ export class HeroViewComp extends CCComp { lastBarUpdateTime:number = 0; // 最后一次血条/蓝条/护盾更新时间 // ==================== UI 节点引用 ==================== private top_node: Node = null!; + private topOpacity: UIOpacity = null!; + private hpBarBasePos: Vec3 = v3(); + private readonly barIdleOpacity: number = 153; + private readonly barActiveOpacity: number = 255; + private readonly idleOpacityDelay: number = 0.25; + private readonly restoreBarIdleOpacity = () => { + this.setTopBarOpacity(false); + }; // ==================== 直接访问 HeroAttrsComp ==================== get model() { @@ -91,15 +99,12 @@ export class HeroViewComp extends CCComp { /** 方向 */ this.node.setScale(this.scale*Math.abs(this.node.scale.x), 1*this.node.scale.y); // 确保 scale.x 为正后再乘方向 this.top_node.setScale(this.scale*this.top_node.scale.x,1*this.top_node.scale.y); - /* 显示角色血*/ this.top_node.getChildByName("hp").active = true; - - this.top_node.getChildByName("mp").active = true - + this.top_node.getChildByName("cd").active = true this.top_node.getChildByName("shield").active = false; - // 初始隐藏血条(有更新时才显示) - this.top_node.active = false; + this.top_node.active = true; + this.setTopBarOpacity(false); // 🔥 重置血条 UI 显示状态 if (this.model) { @@ -110,6 +115,11 @@ export class HeroViewComp extends CCComp { /** 初始化 UI 节点引用 */ private initUINodes() { this.top_node = this.node.getChildByName("top"); + this.topOpacity = this.top_node.getComponent(UIOpacity) || this.top_node.addComponent(UIOpacity); + const hpNode = this.top_node.getChildByName("hp"); + if (hpNode) { + this.hpBarBasePos = hpNode.position.clone(); + } // let hp_y = this.node.getComponent(UITransform).height+10; // this.top_node.setPosition(0, hp_y, 0); } @@ -136,15 +146,6 @@ export class HeroViewComp extends CCComp { return } ; - // 处理血条显示计时(2秒无更新则隐藏) - if (this.lastBarUpdateTime > 0) { - const timeSinceLastUpdate = Date.now() / 1000 - this.lastBarUpdateTime; - if (timeSinceLastUpdate >= 2) { - this.top_node.active = false; - this.lastBarUpdateTime = 0; - } - } - // ✅ View 层职责:处理表现相关的逻辑 this.processDamageQueue(); // 伤害数字显示队列 @@ -161,7 +162,10 @@ export class HeroViewComp extends CCComp { } } - + public cd_show(){ + this.top_node.getChildByName("cd").getComponent(ProgressBar).progress = this.model.s_cd/this.model.s_cd_max; + } + /** 显示护盾 */ private show_shield(shield: number = 0, shield_max: number = 0) { this.lastBarUpdateTime = Date.now() / 1000; @@ -170,9 +174,7 @@ export class HeroViewComp extends CCComp { this.node.getChildByName("shielded").active = shield > 0; this.top_node.getChildByName("shield").active = shield > 0; this.top_node.getChildByName("shield").getComponent(ProgressBar).progress = shield_progress; - this.scheduleOnce(() => { - this.top_node.getChildByName("shield").getChildByName("pb").getComponent(ProgressBar).progress = shield_progress; - }, 0.15); + } /** 显示血量 */ @@ -186,22 +188,50 @@ export class HeroViewComp extends CCComp { let targetProgress = hp / hp_max; let hpNode = this.top_node.getChildByName("hp"); let hpProgressBar = hpNode.getComponent(ProgressBar); - let hpbProgressBar = hpNode.getChildByName("hpb").getComponent(ProgressBar); if (targetProgress < hpProgressBar.progress) { - // 扣血:先扣血(hp),再跟(hpb) + this.activateTopBar(); + this.playHpBarShake(); hpProgressBar.progress = targetProgress; - this.scheduleOnce(() => { - if(hpbProgressBar && hpbProgressBar.isValid) hpbProgressBar.progress = targetProgress; - }, 0.15); - } else { - // 加血:先加底(hpb),再加血(hp) - hpbProgressBar.progress = targetProgress; - this.scheduleOnce(() => { - if(hpProgressBar && hpProgressBar.isValid) hpProgressBar.progress = targetProgress; - }, 0.15); } } + + private isFullHp(): boolean { + if (!this.model) return false; + if (this.model.hp_max <= 0) return false; + return this.model.hp >= this.model.hp_max; + } + + private setTopBarOpacity(isActive: boolean) { + if (!this.topOpacity || !this.topOpacity.isValid) return; + if (isActive) { + this.topOpacity.opacity = this.barActiveOpacity; + return; + } + this.topOpacity.opacity = this.isFullHp() ? this.barIdleOpacity : this.barActiveOpacity; + } + + private activateTopBar() { + this.setTopBarOpacity(true); + this.unschedule(this.restoreBarIdleOpacity); + this.scheduleOnce(this.restoreBarIdleOpacity, this.idleOpacityDelay); + } + + private playHpBarShake() { + const hpNode = this.top_node?.getChildByName("hp"); + if (!hpNode || !hpNode.isValid) return; + Tween.stopAllByTarget(hpNode); + hpNode.setPosition(this.hpBarBasePos); + tween(hpNode) + .by(0.04, { position: v3(-3, 0, 0) }) + .by(0.04, { position: v3(6, 0, 0) }) + .by(0.04, { position: v3(-5, 0, 0) }) + .by(0.04, { position: v3(2, 0, 0) }) + .call(() => { + hpNode.setPosition(this.hpBarBasePos); + }) + .start(); + } @@ -348,26 +378,25 @@ export class HeroViewComp extends CCComp { if(hp<=99) return; this.heathed(); this.hp_tip(TooltipTypes.health, hp.toFixed(0)); - this.top_node.active = true; this.lastBarUpdateTime = Date.now() / 1000; } mp_add(mp: number = 0) { // ✅ 仅显示提示,不调用 mp_show() this.hp_tip(TooltipTypes.addmp, mp.toFixed(0)); - this.top_node.active = true; this.lastBarUpdateTime = Date.now() / 1000; } playIntervalEffect(attr: Attrs, value: number, s_uuid: number) { if (!this.node || !this.node.isValid) return; - this.top_node.active = true; this.lastBarUpdateTime = Date.now() / 1000; if (attr === Attrs.hp) { if (value > 0) { this.heathed(); this.hp_tip(TooltipTypes.health, value.toFixed(0), s_uuid); } else if (value < 0) { + this.activateTopBar(); + this.playHpBarShake(); this.in_atked("atked", this.model?.fac == FacSet.HERO ? 1 : -1); this.hp_tip(TooltipTypes.life, Math.abs(value).toFixed(0), s_uuid); } @@ -398,7 +427,8 @@ export class HeroViewComp extends CCComp { this.as.do_buff(); this.status_change("idle"); this.model.hp =this.model.hp_max*50/100; - this.top_node.active=false + this.top_node.active=true + this.setTopBarOpacity(false); this.lastBarUpdateTime=0 } @@ -424,7 +454,6 @@ export class HeroViewComp extends CCComp { // 防止重复触发 if(this.model.is_count_dead) return; this.model.is_count_dead = true; // 防止重复触发,必须存在防止重复调用 - this.top_node.active=false // 怪物使用0.5秒死亡时间,英雄使用realDeadTime if(this.model.fac === FacSet.MON){ @@ -462,8 +491,8 @@ export class HeroViewComp extends CCComp { } do_atked(damage:number,isCrit:boolean,s_uuid:number,isBack:boolean=false){ - // 受到攻击时显示血条,并更新最后更新时间 - this.top_node.active = true; + // 受到攻击时更新最后更新时间 + this.activateTopBar(); this.lastBarUpdateTime = Date.now() / 1000; if (damage <= 0) return; @@ -573,6 +602,7 @@ export class HeroViewComp extends CCComp { } this.deadCD=0 this.lastBarUpdateTime=0 + this.unschedule(this.restoreBarIdleOpacity); // 清理伤害队列 this.damageQueue.length = 0; diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index d1901834..f38e5e25 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -45,6 +45,8 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate if (!heroAttrs || !heroView || !heroView.node) return; if (heroAttrs.is_dead || heroAttrs.is_reviving || heroAttrs.isStun() || heroAttrs.isFrost()) return; heroAttrs.updateCD(this.dt); + heroView.cd_show(); + const castPlan = this.pickCastSkill(heroAttrs, heroView); if (!this.hasCastTarget(castPlan)) return; this.castSkill(castPlan, heroAttrs, heroView);