From 1a6bff9d49da162f3ecba435238a78702336a18f Mon Sep 17 00:00:00 2001 From: panw Date: Tue, 25 Mar 2025 16:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E7=89=87=E5=8F=AC=E5=94=A4=E8=8B=B1?= =?UTF-8?q?=E9=9B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/gui/card.prefab | 550 +++++++++--------- assets/script/game/common/config/GameEvent.ts | 4 + assets/script/game/map/CardComp.ts | 29 +- assets/script/game/map/MissionHeroComp.ts | 13 +- 4 files changed, 320 insertions(+), 276 deletions(-) diff --git a/assets/resources/game/gui/card.prefab b/assets/resources/game/gui/card.prefab index 0ff794e7..920d1f1b 100644 --- a/assets/resources/game/gui/card.prefab +++ b/assets/resources/game/gui/card.prefab @@ -25,26 +25,26 @@ "__id__": 14 }, { - "__id__": 34 + "__id__": 35 }, { - "__id__": 184 + "__id__": 185 }, { - "__id__": 202 + "__id__": 203 } ], "_active": true, "_components": [ { - "__id__": 210 + "__id__": 211 }, { - "__id__": 212 + "__id__": 213 } ], "_prefab": { - "__id__": 214 + "__id__": 215 }, "_lpos": { "__type__": "cc.Vec3", @@ -380,7 +380,7 @@ } ], "_prefab": { - "__id__": 33 + "__id__": 34 }, "_lpos": { "__type__": "cc.Vec3", @@ -788,7 +788,11 @@ "__prefab": { "__id__": 32 }, - "clickEvents": [], + "clickEvents": [ + { + "__id__": 33 + } + ], "_interactable": true, "_transition": 3, "_normalColor": { @@ -834,6 +838,16 @@ "__type__": "cc.CompPrefabInfo", "fileId": "1f7986x4dIaYbTtAbzNr4v" }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "e06b1QGh45ILZndRut+0seo", + "handler": "use_card", + "customEventData": "" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -857,44 +871,44 @@ }, "_children": [ { - "__id__": 35 + "__id__": 36 }, { - "__id__": 43 + "__id__": 44 }, { - "__id__": 51 + "__id__": 52 }, { - "__id__": 67 + "__id__": 68 }, { - "__id__": 73 + "__id__": 74 }, { - "__id__": 81 + "__id__": 82 }, { - "__id__": 101 + "__id__": 102 }, { - "__id__": 119 + "__id__": 120 }, { - "__id__": 137 + "__id__": 138 } ], "_active": false, "_components": [ { - "__id__": 179 + "__id__": 180 }, { - "__id__": 181 + "__id__": 182 } ], "_prefab": { - "__id__": 183 + "__id__": 184 }, "_lpos": { "__type__": "cc.Vec3", @@ -931,23 +945,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [], "_active": true, "_components": [ { - "__id__": 36 + "__id__": 37 }, { - "__id__": 38 + "__id__": 39 }, { - "__id__": 40 + "__id__": 41 } ], "_prefab": { - "__id__": 42 + "__id__": 43 }, "_lpos": { "__type__": "cc.Vec3", @@ -984,11 +998,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 35 + "__id__": 36 }, "_enabled": true, "__prefab": { - "__id__": 37 + "__id__": 38 }, "_contentSize": { "__type__": "cc.Size", @@ -1012,11 +1026,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 35 + "__id__": 36 }, "_enabled": true, "__prefab": { - "__id__": 39 + "__id__": 40 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1057,11 +1071,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 35 + "__id__": 36 }, "_enabled": true, "__prefab": { - "__id__": 41 + "__id__": 42 }, "_alignFlags": 45, "_target": null, @@ -1106,23 +1120,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [], "_active": true, "_components": [ { - "__id__": 44 + "__id__": 45 }, { - "__id__": 46 + "__id__": 47 }, { - "__id__": 48 + "__id__": 49 } ], "_prefab": { - "__id__": 50 + "__id__": 51 }, "_lpos": { "__type__": "cc.Vec3", @@ -1159,11 +1173,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 43 + "__id__": 44 }, "_enabled": true, "__prefab": { - "__id__": 45 + "__id__": 46 }, "_contentSize": { "__type__": "cc.Size", @@ -1187,11 +1201,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 43 + "__id__": 44 }, "_enabled": true, "__prefab": { - "__id__": 47 + "__id__": 48 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1232,11 +1246,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 43 + "__id__": 44 }, "_enabled": true, "__prefab": { - "__id__": 49 + "__id__": 50 }, "_alignFlags": 45, "_target": null, @@ -1281,30 +1295,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [ { - "__id__": 52 + "__id__": 53 } ], "_active": true, "_components": [ { - "__id__": 58 + "__id__": 59 }, { - "__id__": 60 + "__id__": 61 }, { - "__id__": 62 + "__id__": 63 }, { - "__id__": 64 + "__id__": 65 } ], "_prefab": { - "__id__": 66 + "__id__": 67 }, "_lpos": { "__type__": "cc.Vec3", @@ -1341,20 +1355,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 51 + "__id__": 52 }, "_children": [], "_active": true, "_components": [ { - "__id__": 53 + "__id__": 54 }, { - "__id__": 55 + "__id__": 56 } ], "_prefab": { - "__id__": 57 + "__id__": 58 }, "_lpos": { "__type__": "cc.Vec3", @@ -1391,11 +1405,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 52 + "__id__": 53 }, "_enabled": true, "__prefab": { - "__id__": 54 + "__id__": 55 }, "_contentSize": { "__type__": "cc.Size", @@ -1419,11 +1433,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 52 + "__id__": 53 }, "_enabled": true, "__prefab": { - "__id__": 56 + "__id__": 57 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1477,11 +1491,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 52 }, "_enabled": true, "__prefab": { - "__id__": 59 + "__id__": 60 }, "_contentSize": { "__type__": "cc.Size", @@ -1505,11 +1519,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 52 }, "_enabled": true, "__prefab": { - "__id__": 61 + "__id__": 62 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1550,11 +1564,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 52 }, "_enabled": true, "__prefab": { - "__id__": 63 + "__id__": 64 }, "_alignFlags": 45, "_target": null, @@ -1586,11 +1600,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 52 }, "_enabled": true, "__prefab": { - "__id__": 65 + "__id__": 66 }, "_type": 3, "_inverted": false, @@ -1621,20 +1635,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [], "_active": true, "_components": [ { - "__id__": 68 + "__id__": 69 }, { - "__id__": 70 + "__id__": 71 } ], "_prefab": { - "__id__": 72 + "__id__": 73 }, "_lpos": { "__type__": "cc.Vec3", @@ -1671,11 +1685,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 68 }, "_enabled": true, "__prefab": { - "__id__": 69 + "__id__": 70 }, "_contentSize": { "__type__": "cc.Size", @@ -1699,11 +1713,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 68 }, "_enabled": true, "__prefab": { - "__id__": 71 + "__id__": 72 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1757,23 +1771,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [], "_active": true, "_components": [ { - "__id__": 74 + "__id__": 75 }, { - "__id__": 76 + "__id__": 77 }, { - "__id__": 78 + "__id__": 79 } ], "_prefab": { - "__id__": 80 + "__id__": 81 }, "_lpos": { "__type__": "cc.Vec3", @@ -1810,11 +1824,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 74 }, "_enabled": true, "__prefab": { - "__id__": 75 + "__id__": 76 }, "_contentSize": { "__type__": "cc.Size", @@ -1838,11 +1852,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 74 }, "_enabled": true, "__prefab": { - "__id__": 77 + "__id__": 78 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1906,11 +1920,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 74 }, "_enabled": true, "__prefab": { - "__id__": 79 + "__id__": 80 }, "_alignFlags": 17, "_target": null, @@ -1955,27 +1969,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [ { - "__id__": 82 + "__id__": 83 }, { - "__id__": 90 + "__id__": 91 } ], "_active": true, "_components": [ { - "__id__": 96 + "__id__": 97 }, { - "__id__": 98 + "__id__": 99 } ], "_prefab": { - "__id__": 100 + "__id__": 101 }, "_lpos": { "__type__": "cc.Vec3", @@ -2012,23 +2026,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 81 + "__id__": 82 }, "_children": [], "_active": true, "_components": [ { - "__id__": 83 + "__id__": 84 }, { - "__id__": 85 + "__id__": 86 }, { - "__id__": 87 + "__id__": 88 } ], "_prefab": { - "__id__": 89 + "__id__": 90 }, "_lpos": { "__type__": "cc.Vec3", @@ -2065,11 +2079,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 82 + "__id__": 83 }, "_enabled": true, "__prefab": { - "__id__": 84 + "__id__": 85 }, "_contentSize": { "__type__": "cc.Size", @@ -2093,11 +2107,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 82 + "__id__": 83 }, "_enabled": true, "__prefab": { - "__id__": 86 + "__id__": 87 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2138,11 +2152,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 82 + "__id__": 83 }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 89 }, "_alignFlags": 45, "_target": null, @@ -2187,20 +2201,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 81 + "__id__": 82 }, "_children": [], "_active": true, "_components": [ { - "__id__": 91 + "__id__": 92 }, { - "__id__": 93 + "__id__": 94 } ], "_prefab": { - "__id__": 95 + "__id__": 96 }, "_lpos": { "__type__": "cc.Vec3", @@ -2237,11 +2251,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 90 + "__id__": 91 }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 93 }, "_contentSize": { "__type__": "cc.Size", @@ -2265,11 +2279,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 90 + "__id__": 91 }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 95 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2346,11 +2360,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 81 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 98 }, "_contentSize": { "__type__": "cc.Size", @@ -2374,11 +2388,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 81 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 99 + "__id__": 100 }, "_alignFlags": 4, "_target": null, @@ -2423,27 +2437,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [ { - "__id__": 102 + "__id__": 103 }, { - "__id__": 108 + "__id__": 109 } ], "_active": true, "_components": [ { - "__id__": 114 + "__id__": 115 }, { - "__id__": 116 + "__id__": 117 } ], "_prefab": { - "__id__": 118 + "__id__": 119 }, "_lpos": { "__type__": "cc.Vec3", @@ -2480,20 +2494,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 101 + "__id__": 102 }, "_children": [], "_active": true, "_components": [ { - "__id__": 103 + "__id__": 104 }, { - "__id__": 105 + "__id__": 106 } ], "_prefab": { - "__id__": 107 + "__id__": 108 }, "_lpos": { "__type__": "cc.Vec3", @@ -2530,11 +2544,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 102 + "__id__": 103 }, "_enabled": true, "__prefab": { - "__id__": 104 + "__id__": 105 }, "_contentSize": { "__type__": "cc.Size", @@ -2558,11 +2572,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 102 + "__id__": 103 }, "_enabled": true, "__prefab": { - "__id__": 106 + "__id__": 107 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2616,20 +2630,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 101 + "__id__": 102 }, "_children": [], "_active": true, "_components": [ { - "__id__": 109 + "__id__": 110 }, { - "__id__": 111 + "__id__": 112 } ], "_prefab": { - "__id__": 113 + "__id__": 114 }, "_lpos": { "__type__": "cc.Vec3", @@ -2666,11 +2680,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 108 + "__id__": 109 }, "_enabled": true, "__prefab": { - "__id__": 110 + "__id__": 111 }, "_contentSize": { "__type__": "cc.Size", @@ -2694,11 +2708,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 108 + "__id__": 109 }, "_enabled": true, "__prefab": { - "__id__": 112 + "__id__": 113 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2775,11 +2789,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 101 + "__id__": 102 }, "_enabled": true, "__prefab": { - "__id__": 115 + "__id__": 116 }, "_contentSize": { "__type__": "cc.Size", @@ -2803,11 +2817,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 101 + "__id__": 102 }, "_enabled": true, "__prefab": { - "__id__": 117 + "__id__": 118 }, "_alignFlags": 12, "_target": null, @@ -2852,27 +2866,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [ { - "__id__": 120 + "__id__": 121 }, { - "__id__": 126 + "__id__": 127 } ], "_active": true, "_components": [ { - "__id__": 132 + "__id__": 133 }, { - "__id__": 134 + "__id__": 135 } ], "_prefab": { - "__id__": 136 + "__id__": 137 }, "_lpos": { "__type__": "cc.Vec3", @@ -2909,20 +2923,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 119 + "__id__": 120 }, "_children": [], "_active": true, "_components": [ { - "__id__": 121 + "__id__": 122 }, { - "__id__": 123 + "__id__": 124 } ], "_prefab": { - "__id__": 125 + "__id__": 126 }, "_lpos": { "__type__": "cc.Vec3", @@ -2959,11 +2973,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 120 + "__id__": 121 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 123 }, "_contentSize": { "__type__": "cc.Size", @@ -2987,11 +3001,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 120 + "__id__": 121 }, "_enabled": true, "__prefab": { - "__id__": 124 + "__id__": 125 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3045,20 +3059,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 119 + "__id__": 120 }, "_children": [], "_active": true, "_components": [ { - "__id__": 127 + "__id__": 128 }, { - "__id__": 129 + "__id__": 130 } ], "_prefab": { - "__id__": 131 + "__id__": 132 }, "_lpos": { "__type__": "cc.Vec3", @@ -3095,11 +3109,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 126 + "__id__": 127 }, "_enabled": true, "__prefab": { - "__id__": 128 + "__id__": 129 }, "_contentSize": { "__type__": "cc.Size", @@ -3123,11 +3137,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 126 + "__id__": 127 }, "_enabled": true, "__prefab": { - "__id__": 130 + "__id__": 131 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3204,11 +3218,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 120 }, "_enabled": true, "__prefab": { - "__id__": 133 + "__id__": 134 }, "_contentSize": { "__type__": "cc.Size", @@ -3232,11 +3246,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 120 }, "_enabled": true, "__prefab": { - "__id__": 135 + "__id__": 136 }, "_alignFlags": 36, "_target": null, @@ -3281,39 +3295,39 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 34 + "__id__": 35 }, "_children": [ { - "__id__": 138 + "__id__": 139 }, { - "__id__": 144 + "__id__": 145 }, { - "__id__": 150 + "__id__": 151 }, { - "__id__": 156 + "__id__": 157 }, { - "__id__": 162 + "__id__": 163 }, { - "__id__": 168 + "__id__": 169 } ], "_active": true, "_components": [ { - "__id__": 174 + "__id__": 175 }, { - "__id__": 176 + "__id__": 177 } ], "_prefab": { - "__id__": 178 + "__id__": 179 }, "_lpos": { "__type__": "cc.Vec3", @@ -3350,20 +3364,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 137 + "__id__": 138 }, "_children": [], "_active": true, "_components": [ { - "__id__": 139 + "__id__": 140 }, { - "__id__": 141 + "__id__": 142 } ], "_prefab": { - "__id__": 143 + "__id__": 144 }, "_lpos": { "__type__": "cc.Vec3", @@ -3400,11 +3414,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 138 + "__id__": 139 }, "_enabled": true, "__prefab": { - "__id__": 140 + "__id__": 141 }, "_contentSize": { "__type__": "cc.Size", @@ -3428,11 +3442,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 138 + "__id__": 139 }, "_enabled": true, "__prefab": { - "__id__": 142 + "__id__": 143 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3486,20 +3500,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 137 + "__id__": 138 }, "_children": [], "_active": true, "_components": [ { - "__id__": 145 + "__id__": 146 }, { - "__id__": 147 + "__id__": 148 } ], "_prefab": { - "__id__": 149 + "__id__": 150 }, "_lpos": { "__type__": "cc.Vec3", @@ -3536,11 +3550,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 144 + "__id__": 145 }, "_enabled": true, "__prefab": { - "__id__": 146 + "__id__": 147 }, "_contentSize": { "__type__": "cc.Size", @@ -3564,11 +3578,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 144 + "__id__": 145 }, "_enabled": true, "__prefab": { - "__id__": 148 + "__id__": 149 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3622,20 +3636,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 137 + "__id__": 138 }, "_children": [], "_active": true, "_components": [ { - "__id__": 151 + "__id__": 152 }, { - "__id__": 153 + "__id__": 154 } ], "_prefab": { - "__id__": 155 + "__id__": 156 }, "_lpos": { "__type__": "cc.Vec3", @@ -3672,11 +3686,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 150 + "__id__": 151 }, "_enabled": true, "__prefab": { - "__id__": 152 + "__id__": 153 }, "_contentSize": { "__type__": "cc.Size", @@ -3700,11 +3714,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 150 + "__id__": 151 }, "_enabled": true, "__prefab": { - "__id__": 154 + "__id__": 155 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3758,20 +3772,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 137 + "__id__": 138 }, "_children": [], "_active": true, "_components": [ { - "__id__": 157 + "__id__": 158 }, { - "__id__": 159 + "__id__": 160 } ], "_prefab": { - "__id__": 161 + "__id__": 162 }, "_lpos": { "__type__": "cc.Vec3", @@ -3808,11 +3822,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 156 + "__id__": 157 }, "_enabled": true, "__prefab": { - "__id__": 158 + "__id__": 159 }, "_contentSize": { "__type__": "cc.Size", @@ -3836,11 +3850,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 156 + "__id__": 157 }, "_enabled": true, "__prefab": { - "__id__": 160 + "__id__": 161 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3894,20 +3908,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 137 + "__id__": 138 }, "_children": [], "_active": true, "_components": [ { - "__id__": 163 + "__id__": 164 }, { - "__id__": 165 + "__id__": 166 } ], "_prefab": { - "__id__": 167 + "__id__": 168 }, "_lpos": { "__type__": "cc.Vec3", @@ -3944,11 +3958,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 162 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 164 + "__id__": 165 }, "_contentSize": { "__type__": "cc.Size", @@ -3972,11 +3986,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 162 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 166 + "__id__": 167 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4030,20 +4044,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 137 + "__id__": 138 }, "_children": [], "_active": true, "_components": [ { - "__id__": 169 + "__id__": 170 }, { - "__id__": 171 + "__id__": 172 } ], "_prefab": { - "__id__": 173 + "__id__": 174 }, "_lpos": { "__type__": "cc.Vec3", @@ -4080,11 +4094,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 168 + "__id__": 169 }, "_enabled": true, "__prefab": { - "__id__": 170 + "__id__": 171 }, "_contentSize": { "__type__": "cc.Size", @@ -4108,11 +4122,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 168 + "__id__": 169 }, "_enabled": true, "__prefab": { - "__id__": 172 + "__id__": 173 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4166,11 +4180,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 137 + "__id__": 138 }, "_enabled": true, "__prefab": { - "__id__": 175 + "__id__": 176 }, "_contentSize": { "__type__": "cc.Size", @@ -4194,11 +4208,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 137 + "__id__": 138 }, "_enabled": true, "__prefab": { - "__id__": 177 + "__id__": 178 }, "_resizeMode": 1, "_layoutType": 1, @@ -4245,11 +4259,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 34 + "__id__": 35 }, "_enabled": true, "__prefab": { - "__id__": 180 + "__id__": 181 }, "_contentSize": { "__type__": "cc.Size", @@ -4273,11 +4287,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 34 + "__id__": 35 }, "_enabled": true, "__prefab": { - "__id__": 182 + "__id__": 183 }, "_alignFlags": 45, "_target": null, @@ -4326,26 +4340,26 @@ }, "_children": [ { - "__id__": 185 + "__id__": 186 } ], "_active": true, "_components": [ { - "__id__": 193 + "__id__": 194 }, { - "__id__": 195 + "__id__": 196 }, { - "__id__": 197 + "__id__": 198 }, { - "__id__": 199 + "__id__": 200 } ], "_prefab": { - "__id__": 201 + "__id__": 202 }, "_lpos": { "__type__": "cc.Vec3", @@ -4382,23 +4396,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 184 + "__id__": 185 }, "_children": [], "_active": true, "_components": [ { - "__id__": 186 + "__id__": 187 }, { - "__id__": 188 + "__id__": 189 }, { - "__id__": 190 + "__id__": 191 } ], "_prefab": { - "__id__": 192 + "__id__": 193 }, "_lpos": { "__type__": "cc.Vec3", @@ -4435,11 +4449,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 185 + "__id__": 186 }, "_enabled": true, "__prefab": { - "__id__": 187 + "__id__": 188 }, "_contentSize": { "__type__": "cc.Size", @@ -4463,11 +4477,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 185 + "__id__": 186 }, "_enabled": true, "__prefab": { - "__id__": 189 + "__id__": 190 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4508,11 +4522,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 185 + "__id__": 186 }, "_enabled": true, "__prefab": { - "__id__": 191 + "__id__": 192 }, "playOnLoad": false, "_clips": [ @@ -4550,11 +4564,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 185 }, "_enabled": true, "__prefab": { - "__id__": 194 + "__id__": 195 }, "_contentSize": { "__type__": "cc.Size", @@ -4578,11 +4592,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 185 }, "_enabled": true, "__prefab": { - "__id__": 196 + "__id__": 197 }, "_type": 0, "_inverted": false, @@ -4600,11 +4614,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 185 }, "_enabled": true, "__prefab": { - "__id__": 198 + "__id__": 199 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4646,11 +4660,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 185 }, "_enabled": true, "__prefab": { - "__id__": 200 + "__id__": 201 }, "_alignFlags": 45, "_target": null, @@ -4701,17 +4715,17 @@ "_active": true, "_components": [ { - "__id__": 203 + "__id__": 204 }, { - "__id__": 205 + "__id__": 206 }, { - "__id__": 207 + "__id__": 208 } ], "_prefab": { - "__id__": 209 + "__id__": 210 }, "_lpos": { "__type__": "cc.Vec3", @@ -4748,11 +4762,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 202 + "__id__": 203 }, "_enabled": true, "__prefab": { - "__id__": 204 + "__id__": 205 }, "_contentSize": { "__type__": "cc.Size", @@ -4776,11 +4790,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 202 + "__id__": 203 }, "_enabled": true, "__prefab": { - "__id__": 206 + "__id__": 207 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4821,11 +4835,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 202 + "__id__": 203 }, "_enabled": true, "__prefab": { - "__id__": 208 + "__id__": 209 }, "_alignFlags": 45, "_target": null, @@ -4874,7 +4888,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 211 + "__id__": 212 }, "_contentSize": { "__type__": "cc.Size", @@ -4902,7 +4916,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 213 + "__id__": 214 }, "_id": "" }, diff --git a/assets/script/game/common/config/GameEvent.ts b/assets/script/game/common/config/GameEvent.ts index a581a315..55f67ec4 100644 --- a/assets/script/game/common/config/GameEvent.ts +++ b/assets/script/game/common/config/GameEvent.ts @@ -16,4 +16,8 @@ export enum GameEvent { MissionEnd = "MissionEnd", CastSkill = "CastSkill", CardRefresh = "CardRefresh", + UseCard = "UseCard", + UserHeroCard = "UserHeroCard", + UserSkillCard = "UserSkillCard", + } \ No newline at end of file diff --git a/assets/script/game/map/CardComp.ts b/assets/script/game/map/CardComp.ts index ac02fc47..45729515 100644 --- a/assets/script/game/map/CardComp.ts +++ b/assets/script/game/map/CardComp.ts @@ -4,6 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu import { GameEvent } from "../common/config/GameEvent"; import { HeroInfo, HeroList } from "../common/config/heroSet"; import { RandomManager } from "db://oops-framework/core/common/random/RandomManager"; +import { oops } from "db://oops-framework/core/Oops"; const { ccclass, property } = _decorator; @@ -13,14 +14,20 @@ const { ccclass, property } = _decorator; export class CardComp extends CCComp { c_uuid:number=0; c_type:number=0; + is_used:boolean=false; onLoad(){ this.on(GameEvent.CardRefresh,this.onCardRefresh,this) } start() { - + this.init_card() + } + init_card(){ + this.is_used=true + this.node.getChildByName("Button").active=false + this.node.getChildByName("show").active=false } onCardRefresh(event: string, args: any){ - + this.is_used=false let hero_list =HeroList let x=RandomManager.instance.getRandomInt(0,hero_list.length,1) this.c_uuid=hero_list[x] @@ -30,6 +37,7 @@ export class CardComp extends CCComp { this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup') this.scheduleOnce(() => { this.node.getChildByName("show").active=true + this.node.getChildByName("Button").active=true }, 0.1); } @@ -45,6 +53,23 @@ export class CardComp extends CCComp { }); } + use_card(){ + if(this.is_used) return + switch(this.c_type){ + case 0: + oops.message.dispatchEvent(GameEvent.UserHeroCard,{uuid:this.c_uuid}) + break + case 1: + oops.message.dispatchEvent(GameEvent.UserSkillCard,{uuid:this.c_uuid}) + break + case 2: + oops.message.dispatchEvent(GameEvent.UseCard,{uuid:this.c_uuid}) + break + } + this.node.getChildByName("show").active=false + this.is_used=true + this.node.getChildByName("Button").active=false + } reset() { this.node.destroy(); } diff --git a/assets/script/game/map/MissionHeroComp.ts b/assets/script/game/map/MissionHeroComp.ts index bb1983a8..45e7eb23 100644 --- a/assets/script/game/map/MissionHeroComp.ts +++ b/assets/script/game/map/MissionHeroComp.ts @@ -7,6 +7,7 @@ import { Hero } from "../hero/Hero"; import { smc } from "../common/SingletonModuleComp"; import { Timer } from "db://oops-framework/core/common/timer/Timer"; import { RandomManager } from "db://oops-framework/core/common/random/RandomManager"; +import { GameEvent } from "../common/config/GameEvent"; const { ccclass, property } = _decorator; @@ -15,21 +16,21 @@ const { ccclass, property } = _decorator; @ecs.register('MissionHeroComp', false) export class MissionHeroCompComp extends CCComp { timer:Timer=new Timer(2) - + onLoad(){ + this.on(GameEvent.UserHeroCard,this.call_hero,this) + } start() { } protected update(dt: number): void { if(smc.mission.status != 1) return - if(this.timer.update(dt)){ - this.call_hero() - } + } - call_hero(){ + call_hero(event: string, args: any){ this.timer.reset() let hero_list =HeroList let x=RandomManager.instance.getRandomInt(0,hero_list.length,1) - let uuid=hero_list[x] + let uuid=args.uuid console.log("call_hero",uuid) this.addHero(uuid) }