From e89f59097924865d22f154e672ea8f1b60a38a51 Mon Sep 17 00:00:00 2001 From: "pan@work" Date: Tue, 19 Nov 2024 10:52:20 +0800 Subject: [PATCH] =?UTF-8?q?heros=20=E5=8D=A1=E7=89=87=20=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E5=AE=8C=E5=96=84=20=E6=80=9D=E8=80=83=E4=B8=8B=E6=AD=A5?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/hero/k1.prefab | 8 +- assets/resources/gui/element/hcard.prefab | 1169 +++++++++++-------- assets/resources/gui/role_controller.prefab | 2 +- assets/script/game/hero/HeroViewComp.ts | 9 +- assets/script/game/map/HCardComp.ts | 26 +- assets/script/game/map/MIssionController.ts | 9 +- 6 files changed, 694 insertions(+), 529 deletions(-) diff --git a/assets/resources/game/hero/k1.prefab b/assets/resources/game/hero/k1.prefab index 83d9bfd5..1772923e 100644 --- a/assets/resources/game/hero/k1.prefab +++ b/assets/resources/game/hero/k1.prefab @@ -1406,13 +1406,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.3, - "y": 39.7 + "x": 8.4, + "y": 46.3 }, "_size": { "__type__": "cc.Size", - "width": 38.2, - "height": 59.6 + "width": 57.6, + "height": 71 }, "_id": "" }, diff --git a/assets/resources/gui/element/hcard.prefab b/assets/resources/gui/element/hcard.prefab index a7766f4a..c01fc5cd 100644 --- a/assets/resources/gui/element/hcard.prefab +++ b/assets/resources/gui/element/hcard.prefab @@ -46,26 +46,29 @@ "__id__": 56 }, { - "__id__": 76 + "__id__": 68 }, { - "__id__": 88 + "__id__": 80 + }, + { + "__id__": 94 } ], "_active": true, "_components": [ { - "__id__": 100 + "__id__": 108 }, { - "__id__": 102 + "__id__": 110 }, { - "__id__": 104 + "__id__": 112 } ], "_prefab": { - "__id__": 106 + "__id__": 114 }, "_lpos": { "__type__": "cc.Vec3", @@ -160,7 +163,7 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 280, + "width": 260, "height": 300 }, "_anchorPoint": { @@ -1372,7 +1375,7 @@ }, { "__type__": "cc.Node", - "_name": "ProgressBar", + "_name": "ap", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -1381,30 +1384,24 @@ "_children": [ { "__id__": 57 - }, - { - "__id__": 63 } ], "_active": true, "_components": [ { - "__id__": 69 + "__id__": 63 }, { - "__id__": 71 - }, - { - "__id__": 73 + "__id__": 65 } ], "_prefab": { - "__id__": 75 + "__id__": 67 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": -62.722, + "x": -50.47, + "y": -15.436, "z": 0 }, "_lrot": { @@ -1416,8 +1413,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, - "y": 1, + "x": 0.5, + "y": 0.5, "z": 1 }, "_mobility": 0, @@ -1432,7 +1429,7 @@ }, { "__type__": "cc.Node", - "_name": "Bar", + "_name": "num", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -1453,7 +1450,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -65, + "x": 20, "y": 0, "z": 0 }, @@ -1494,467 +1491,7 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 130, - "height": 20 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "e8ntLxafJIDpzvcelY1QAI" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 57 - }, - "_enabled": true, - "__prefab": { - "__id__": 61 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@5c4a5", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "27n+0aqHFEi4637gjuTxVh" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "d2nLGnRUFMF6Pec/yBHj/W", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "exp", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 56 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 64 - }, - { - "__id__": 66 - } - ], - "_prefab": { - "__id__": 68 - }, - "_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": 0.9999999999999999, - "y": 0.9999999999999999, - "z": 0.9999999999999999 - }, - "_mobility": 0, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 63 - }, - "_enabled": true, - "__prefab": { - "__id__": 65 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 42.92578125, - "height": 54.4 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "f5nfyR+bBF276jBECYbemp" - }, - { - "__type__": "cc.Label", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 63 - }, - "_enabled": true, - "__prefab": { - "__id__": 67 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_string": "1/10", - "_horizontalAlign": 1, - "_verticalAlign": 1, - "_actualFontSize": 20, - "_fontSize": 20, - "_fontFamily": "Arial", - "_lineHeight": 40, - "_overflow": 0, - "_enableWrapText": true, - "_font": null, - "_isSystemFontUsed": true, - "_spacingX": 0, - "_isItalic": false, - "_isBold": false, - "_isUnderline": false, - "_underlineHeight": 2, - "_cacheMode": 0, - "_enableOutline": true, - "_outlineColor": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_outlineWidth": 2, - "_enableShadow": false, - "_shadowColor": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_shadowOffset": { - "__type__": "cc.Vec2", - "x": 2, - "y": 2 - }, - "_shadowBlur": 2, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "bd7oDYK+1ExbpipgeZZ8oy" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "d5pFJTEqpKTapYcj+pTEku", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 56 - }, - "_enabled": true, - "__prefab": { - "__id__": 70 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 130, - "height": 20 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "bfnIv/iphHi5I2LeTvdLG2" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 56 - }, - "_enabled": true, - "__prefab": { - "__id__": 72 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@0e130", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 1, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "1dKrj/V+BCj6QUxkZEeBBi" - }, - { - "__type__": "cc.ProgressBar", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 56 - }, - "_enabled": true, - "__prefab": { - "__id__": 74 - }, - "_barSprite": { - "__id__": 60 - }, - "_mode": 0, - "_totalLength": 130, - "_progress": 1, - "_reverse": false, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "268lEzU/xExZjaA1mptdhP" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "38JsxcOABPVaAjpq1JTAPN", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "ap", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [ - { - "__id__": 77 - } - ], - "_active": true, - "_components": [ - { - "__id__": 83 - }, - { - "__id__": 85 - } - ], - "_prefab": { - "__id__": 87 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -50.47, - "y": -15.436, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 0.5, - "y": 0.5, - "z": 1 - }, - "_mobility": 0, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.Node", - "_name": "num", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 76 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 78 - }, - { - "__id__": 80 - } - ], - "_prefab": { - "__id__": 82 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 20, - "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": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 77 - }, - "_enabled": true, - "__prefab": { - "__id__": 79 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 200, + "width": 180, "height": 40 }, "_anchorPoint": { @@ -1974,11 +1511,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 57 }, "_enabled": true, "__prefab": { - "__id__": 81 + "__id__": 61 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2055,11 +1592,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 76 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 84 + "__id__": 64 }, "_contentSize": { "__type__": "cc.Size", @@ -2083,11 +1620,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 76 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 86 + "__id__": 66 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2145,20 +1682,20 @@ }, "_children": [ { - "__id__": 89 + "__id__": 69 } ], "_active": true, "_components": [ { - "__id__": 95 + "__id__": 75 }, { - "__id__": 97 + "__id__": 77 } ], "_prefab": { - "__id__": 99 + "__id__": 79 }, "_lpos": { "__type__": "cc.Vec3", @@ -2195,20 +1732,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 88 + "__id__": 68 }, "_children": [], "_active": true, "_components": [ { - "__id__": 90 + "__id__": 70 }, { - "__id__": 92 + "__id__": 72 } ], "_prefab": { - "__id__": 94 + "__id__": 74 }, "_lpos": { "__type__": "cc.Vec3", @@ -2245,15 +1782,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 89 + "__id__": 69 }, "_enabled": true, "__prefab": { - "__id__": 91 + "__id__": 71 }, "_contentSize": { "__type__": "cc.Size", - "width": 200, + "width": 180, "height": 40 }, "_anchorPoint": { @@ -2273,11 +1810,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 89 + "__id__": 69 }, "_enabled": true, "__prefab": { - "__id__": 93 + "__id__": 73 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2289,7 +1826,7 @@ "b": 255, "a": 255 }, - "_string": "100/100", + "_string": "100", "_horizontalAlign": 0, "_verticalAlign": 1, "_actualFontSize": 40, @@ -2354,11 +1891,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 68 }, "_enabled": true, "__prefab": { - "__id__": 96 + "__id__": 76 }, "_contentSize": { "__type__": "cc.Size", @@ -2382,11 +1919,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 68 }, "_enabled": true, "__prefab": { - "__id__": 98 + "__id__": 78 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2434,6 +1971,614 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_name": "life", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 81 + } + ], + "_active": true, + "_components": [ + { + "__id__": 87 + }, + { + "__id__": 89 + }, + { + "__id__": 91 + } + ], + "_prefab": { + "__id__": 93 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -58.722, + "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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Bar", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 80 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 82 + }, + { + "__id__": 84 + } + ], + "_prefab": { + "__id__": 86 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -65, + "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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 81 + }, + "_enabled": true, + "__prefab": { + "__id__": 83 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 130, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a93K1SuvRPYYe5+CiEPHRB" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 81 + }, + "_enabled": true, + "__prefab": { + "__id__": 85 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@39df8", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b3SPmV03pNGoduW9McOjx/" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "231EYz9FdBZ6RUIQFeXN2g", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 80 + }, + "_enabled": true, + "__prefab": { + "__id__": 88 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 130, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "63/0VAbtVIqImhb0SaaV/a" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 80 + }, + "_enabled": true, + "__prefab": { + "__id__": 90 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@0e130", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b3WQgNb+9K/rCedfj4APb7" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 80 + }, + "_enabled": true, + "__prefab": { + "__id__": 92 + }, + "_barSprite": { + "__id__": 84 + }, + "_mode": 0, + "_totalLength": 130, + "_progress": 1, + "_reverse": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "ddq4GXI+JDup+JPcKHW8k5" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "e6ul0bxWtCAokNZV1piWDw", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "pow", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 95 + } + ], + "_active": true, + "_components": [ + { + "__id__": 101 + }, + { + "__id__": 103 + }, + { + "__id__": 105 + } + ], + "_prefab": { + "__id__": 107 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -75.805, + "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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Bar", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 94 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 96 + }, + { + "__id__": 98 + } + ], + "_prefab": { + "__id__": 100 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -65, + "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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 95 + }, + "_enabled": true, + "__prefab": { + "__id__": 97 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 130, + "height": 10 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "e8ntLxafJIDpzvcelY1QAI" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 95 + }, + "_enabled": true, + "__prefab": { + "__id__": 99 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@5c4a5", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "27n+0aqHFEi4637gjuTxVh" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "d2nLGnRUFMF6Pec/yBHj/W", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 94 + }, + "_enabled": true, + "__prefab": { + "__id__": 102 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 130, + "height": 1 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "bfnIv/iphHi5I2LeTvdLG2" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 94 + }, + "_enabled": true, + "__prefab": { + "__id__": 104 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@0e130", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "1dKrj/V+BCj6QUxkZEeBBi" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 94 + }, + "_enabled": true, + "__prefab": { + "__id__": 106 + }, + "_barSprite": { + "__id__": 98 + }, + "_mode": 0, + "_totalLength": 130, + "_progress": 1, + "_reverse": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "268lEzU/xExZjaA1mptdhP" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "38JsxcOABPVaAjpq1JTAPN", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", @@ -2444,11 +2589,11 @@ }, "_enabled": true, "__prefab": { - "__id__": 101 + "__id__": 109 }, "_contentSize": { "__type__": "cc.Size", - "width": 140, + "width": 130, "height": 200 }, "_anchorPoint": { @@ -2472,7 +2617,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 103 + "__id__": 111 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2514,7 +2659,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 105 + "__id__": 113 }, "_id": "" }, diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index aa2743ba..e1ed7388 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -19282,7 +19282,7 @@ ], "value": { "__type__": "cc.Vec3", - "x": 141, + "x": 283, "y": -100, "z": 0 } diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 5cd9ab97..ca8d0fc5 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -170,11 +170,10 @@ export class HeroViewComp extends CCComp { } onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D) { + let self_x = selfCollider.node.position.x; + let other_x = otherCollider.node.position.x; if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){ - if(otherCollider.node.name=="role") return - let self_x = selfCollider.node.position.x; - let other_x = otherCollider.node.position.x; - if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x < other_x && Math.abs(other_x-self_x) < 30 ){ + if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x < other_x && Math.abs(other_x-self_x) < 15 ){ this.stop_cd = 0.1; } // if(selfCollider.node.position.y < otherCollider.node.position.y){ @@ -265,7 +264,7 @@ export class HeroViewComp extends CCComp { if(dir < this.dis){ this.is_atking=true - this.stop_cd = 0.1 + if(this.dis-dir > 45 ) this.stop_cd = 0.1 }else{ this.is_atking=false } diff --git a/assets/script/game/map/HCardComp.ts b/assets/script/game/map/HCardComp.ts index cc3038ac..207a473e 100644 --- a/assets/script/game/map/HCardComp.ts +++ b/assets/script/game/map/HCardComp.ts @@ -1,4 +1,4 @@ -import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,UITransform,v3 } from "cc"; +import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,ProgressBar,resources,Sprite,SpriteAtlas,UITransform,v3 } 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 { smc } from "../common/SingletonModuleComp"; @@ -13,16 +13,32 @@ const { ccclass, property } = _decorator; @ecs.register('HCardComp', false) export class HCardComp extends CCComp { hi: number = 0; - + heros:any = [] + icon:any=[] + hc_name:any=[] + ap:any=[] + hp:any=[] + life:any=[] protected onLoad(): void { } start() { - let heros:any= ecs.query(ecs.allOf(HeroModelComp)); - this.node.getChildByName("name").getComponent(Label)!.string = heros[this.hi].HeroView.hero_name + this.heros= ecs.query(ecs.allOf(HeroModelComp)); + this.hc_name=this.node.getChildByName("name").getComponent(Label)! + this.icon=this.node.getChildByName("icon").getComponent(Sprite)! + this.hp=this.node.getChildByName("hp").getChildByName("num").getComponent(Label)! + this.ap=this.node.getChildByName("ap").getChildByName("num").getComponent(Label)! + this.life=this.node.getChildByName("life").getComponent(ProgressBar)! + this.hc_name.string= this.heros[this.hi].HeroView.hero_name + console.log("hcard start") + } + protected update(dt: number): void { + this.hp.string=this.heros[this.hi].HeroView.hp_max + this.ap.string=this.heros[this.hi].HeroView.ap + this.life.progress=this.heros[this.hi].HeroView.hp/this.heros[this.hi].HeroView.hp_max + } - /** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */ reset() { console.log("hcard reset"); diff --git a/assets/script/game/map/MIssionController.ts b/assets/script/game/map/MIssionController.ts index 1184dc95..628c7d3b 100644 --- a/assets/script/game/map/MIssionController.ts +++ b/assets/script/game/map/MIssionController.ts @@ -119,7 +119,8 @@ export class MissionComp extends CCComp { } mission_end(){ smc.vm_data.mission.play=false - let heros:any= ecs.query(ecs.allOf(HeroViewComp)); + let heros:any= ecs.query(ecs.allOf(HeroModelComp)); + let monsters:any= ecs.query(ecs.allOf(MonModelComp)); let hcards:any= ecs.query(ecs.allOf(HCardComp)); let hcns=this.node.getChildByName("hcards") for(let i=0;i(HCard) console.log("hcard:",hcard) - hcard.load(1001,0,node) + hcard.load(1001,i,node) } }