From fae958aac6cff9f1469a72f0abf243238e48ccba Mon Sep 17 00:00:00 2001 From: "PC-20230316NUNE\\Administrator" <2858626794@qq.com> Date: Thu, 7 Dec 2023 21:34:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/prefab/ui/主页/MainView.prefab | 571 +++++++++--------- JisolGameCocos/assets/script/App.ts | 32 +- .../script/battle/GBattleModeManager.ts | 34 +- .../assets/script/tools/BattleResource.ts | 26 + .../script/tools/BattleResource.ts.meta | 9 + 5 files changed, 375 insertions(+), 297 deletions(-) create mode 100644 JisolGameCocos/assets/script/tools/BattleResource.ts create mode 100644 JisolGameCocos/assets/script/tools/BattleResource.ts.meta diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab index 0b900bc6..06585bae 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab @@ -25,32 +25,32 @@ "__id__": 10 }, { - "__id__": 78 + "__id__": 79 }, { - "__id__": 164 + "__id__": 165 }, { - "__id__": 183 + "__id__": 184 }, { - "__id__": 198 + "__id__": 199 } ], "_active": true, "_components": [ { - "__id__": 213 + "__id__": 214 }, { - "__id__": 215 + "__id__": 216 }, { - "__id__": 217 + "__id__": 218 } ], "_prefab": { - "__id__": 219 + "__id__": 220 }, "_lpos": { "__type__": "cc.Vec3", @@ -269,26 +269,26 @@ "__id__": 11 }, { - "__id__": 26 + "__id__": 27 }, { - "__id__": 42 + "__id__": 43 }, { - "__id__": 54 + "__id__": 55 } ], "_active": true, "_components": [ { - "__id__": 73 + "__id__": 74 }, { - "__id__": 75 + "__id__": 76 } ], "_prefab": { - "__id__": 77 + "__id__": 78 }, "_lpos": { "__type__": "cc.Vec3", @@ -375,6 +375,9 @@ }, { "__id__": 25 + }, + { + "__id__": 26 } ], "removedComponents": [] @@ -532,6 +535,16 @@ "height": 1280 } }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 19 + }, + "propertyPath": [ + "_active" + ], + "value": true + }, { "__type__": "cc.Node", "_name": "玩家信息", @@ -542,23 +555,23 @@ }, "_children": [ { - "__id__": 27 + "__id__": 28 } ], "_active": true, "_components": [ { - "__id__": 35 + "__id__": 36 }, { - "__id__": 37 + "__id__": 38 }, { - "__id__": 39 + "__id__": 40 } ], "_prefab": { - "__id__": 41 + "__id__": 42 }, "_lpos": { "__type__": "cc.Vec3", @@ -595,23 +608,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 26 + "__id__": 27 }, "_children": [], "_active": true, "_components": [ { - "__id__": 28 + "__id__": 29 }, { - "__id__": 30 + "__id__": 31 }, { - "__id__": 32 + "__id__": 33 } ], "_prefab": { - "__id__": 34 + "__id__": 35 }, "_lpos": { "__type__": "cc.Vec3", @@ -648,11 +661,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 27 + "__id__": 28 }, "_enabled": true, "__prefab": { - "__id__": 29 + "__id__": 30 }, "_contentSize": { "__type__": "cc.Size", @@ -676,11 +689,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 27 + "__id__": 28 }, "_enabled": true, "__prefab": { - "__id__": 31 + "__id__": 32 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -721,11 +734,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 27 + "__id__": 28 }, "_enabled": true, "__prefab": { - "__id__": 33 + "__id__": 34 }, "_color": { "__type__": "cc.Color", @@ -760,11 +773,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 36 + "__id__": 37 }, "_contentSize": { "__type__": "cc.Size", @@ -788,11 +801,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 38 + "__id__": 39 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -833,11 +846,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 40 + "__id__": 41 }, "_alignFlags": 9, "_target": null, @@ -883,14 +896,14 @@ "__id__": 10 }, "_prefab": { - "__id__": 43 + "__id__": 44 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 42 + "__id__": 43 }, "asset": { "__uuid__": "f9a7b5b8-0c1a-4b0c-a6c7-bbf2e077442a", @@ -898,7 +911,7 @@ }, "fileId": "7ehoARooRAIIfX4ttdeppc", "instance": { - "__id__": 44 + "__id__": 45 }, "targetOverrides": null }, @@ -911,21 +924,21 @@ "mountedChildren": [], "mountedComponents": [ { - "__id__": 45 + "__id__": 46 } ], "propertyOverrides": [ { - "__id__": 49 - }, - { - "__id__": 51 + "__id__": 50 }, { "__id__": 52 }, { "__id__": 53 + }, + { + "__id__": 54 } ], "removedComponents": [] @@ -933,11 +946,11 @@ { "__type__": "cc.MountedComponentsInfo", "targetInfo": { - "__id__": 46 + "__id__": 47 }, "components": [ { - "__id__": 47 + "__id__": 48 } ] }, @@ -953,15 +966,15 @@ "_objFlags": 0, "__editorExtras__": { "mountedRoot": { - "__id__": 42 + "__id__": 43 } }, "node": { - "__id__": 42 + "__id__": 43 }, "_enabled": true, "__prefab": { - "__id__": 48 + "__id__": 49 }, "_alignFlags": 1, "_target": null, @@ -990,7 +1003,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 50 + "__id__": 51 }, "propertyPath": [ "_name" @@ -1006,7 +1019,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 50 + "__id__": 51 }, "propertyPath": [ "_lpos" @@ -1021,7 +1034,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 50 + "__id__": 51 }, "propertyPath": [ "_lrot" @@ -1037,7 +1050,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 50 + "__id__": 51 }, "propertyPath": [ "_euler" @@ -1059,26 +1072,26 @@ }, "_children": [ { - "__id__": 55 + "__id__": 56 } ], "_active": true, "_components": [ { - "__id__": 63 + "__id__": 64 }, { - "__id__": 65 + "__id__": 66 }, { - "__id__": 67 + "__id__": 68 }, { - "__id__": 70 + "__id__": 71 } ], "_prefab": { - "__id__": 72 + "__id__": 73 }, "_lpos": { "__type__": "cc.Vec3", @@ -1115,23 +1128,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 54 + "__id__": 55 }, "_children": [], "_active": true, "_components": [ { - "__id__": 56 + "__id__": 57 }, { - "__id__": 58 + "__id__": 59 }, { - "__id__": 60 + "__id__": 61 } ], "_prefab": { - "__id__": 62 + "__id__": 63 }, "_lpos": { "__type__": "cc.Vec3", @@ -1168,11 +1181,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 55 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 57 + "__id__": 58 }, "_contentSize": { "__type__": "cc.Size", @@ -1196,11 +1209,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 55 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 59 + "__id__": 60 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1241,11 +1254,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 55 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 61 + "__id__": 62 }, "_color": { "__type__": "cc.Color", @@ -1280,11 +1293,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 55 }, "_enabled": true, "__prefab": { - "__id__": 64 + "__id__": 65 }, "_contentSize": { "__type__": "cc.Size", @@ -1308,11 +1321,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 55 }, "_enabled": true, "__prefab": { - "__id__": 66 + "__id__": 67 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1353,15 +1366,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 55 }, "_enabled": true, "__prefab": { - "__id__": 68 + "__id__": 69 }, "clickEvents": [ { - "__id__": 69 + "__id__": 70 } ], "_interactable": true, @@ -1413,7 +1426,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 54 + "__id__": 55 }, "_id": "" }, @@ -1437,11 +1450,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 55 }, "_enabled": true, "__prefab": { - "__id__": 71 + "__id__": 72 }, "_alignFlags": 36, "_target": null, @@ -1490,7 +1503,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 74 + "__id__": 75 }, "_contentSize": { "__type__": "cc.Size", @@ -1518,7 +1531,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 76 + "__id__": 77 }, "_alignFlags": 45, "_target": null, @@ -1567,29 +1580,29 @@ }, "_children": [ { - "__id__": 79 + "__id__": 80 }, { - "__id__": 103 + "__id__": 104 }, { - "__id__": 117 + "__id__": 118 } ], "_active": true, "_components": [ { - "__id__": 157 + "__id__": 158 }, { - "__id__": 159 + "__id__": 160 }, { - "__id__": 161 + "__id__": 162 } ], "_prefab": { - "__id__": 163 + "__id__": 164 }, "_lpos": { "__type__": "cc.Vec3", @@ -1624,17 +1637,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 78 + "__id__": 79 }, "_prefab": { - "__id__": 80 + "__id__": 81 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 79 + "__id__": 80 }, "asset": { "__uuid__": "a9053170-1055-4272-b3fd-ad6fa75b5f25", @@ -1642,7 +1655,7 @@ }, "fileId": "cfqtEvOKpHO7NzoHh8DAIM", "instance": { - "__id__": 81 + "__id__": 82 }, "targetOverrides": null }, @@ -1656,10 +1669,7 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 82 - }, - { - "__id__": 84 + "__id__": 83 }, { "__id__": 85 @@ -1671,28 +1681,31 @@ "__id__": 87 }, { - "__id__": 89 + "__id__": 88 }, { - "__id__": 91 + "__id__": 90 }, { - "__id__": 93 + "__id__": 92 }, { - "__id__": 95 + "__id__": 94 }, { - "__id__": 97 + "__id__": 96 }, { - "__id__": 99 + "__id__": 98 }, { - "__id__": 101 + "__id__": 100 }, { "__id__": 102 + }, + { + "__id__": 103 } ], "removedComponents": [] @@ -1700,7 +1713,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 83 + "__id__": 84 }, "propertyPath": [ "_name" @@ -1716,7 +1729,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 83 + "__id__": 84 }, "propertyPath": [ "_lpos" @@ -1731,7 +1744,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 83 + "__id__": 84 }, "propertyPath": [ "_lrot" @@ -1747,7 +1760,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 83 + "__id__": 84 }, "propertyPath": [ "_euler" @@ -1762,7 +1775,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 89 }, "propertyPath": [ "_right" @@ -1778,7 +1791,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 90 + "__id__": 91 }, "propertyPath": [ "_contentSize" @@ -1798,7 +1811,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 92 + "__id__": 93 }, "propertyPath": [ "_lpos" @@ -1819,7 +1832,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 94 + "__id__": 95 }, "propertyPath": [ "_contentSize" @@ -1839,7 +1852,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 96 + "__id__": 97 }, "propertyPath": [ "_contentSize" @@ -1859,7 +1872,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 98 + "__id__": 99 }, "propertyPath": [ "_lpos" @@ -1880,7 +1893,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 100 + "__id__": 101 }, "propertyPath": [ "_lpos" @@ -1901,7 +1914,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 89 }, "propertyPath": [ "_alignFlags" @@ -1911,7 +1924,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 89 }, "propertyPath": [ "_top" @@ -1924,24 +1937,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 78 + "__id__": 79 }, "_children": [ { - "__id__": 104 + "__id__": 105 } ], "_active": true, "_components": [ { - "__id__": 112 + "__id__": 113 }, { - "__id__": 114 + "__id__": 115 } ], "_prefab": { - "__id__": 116 + "__id__": 117 }, "_lpos": { "__type__": "cc.Vec3", @@ -1976,17 +1989,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 103 + "__id__": 104 }, "_prefab": { - "__id__": 105 + "__id__": 106 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 104 + "__id__": 105 }, "asset": { "__uuid__": "9d7eeadb-58f6-4c42-aaed-bc402f272c84", @@ -1994,7 +2007,7 @@ }, "fileId": "a8T0NC/KpNY7MMbRkPRuwY", "instance": { - "__id__": 106 + "__id__": 107 }, "targetOverrides": null }, @@ -2008,16 +2021,16 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 107 - }, - { - "__id__": 109 + "__id__": 108 }, { "__id__": 110 }, { "__id__": 111 + }, + { + "__id__": 112 } ], "removedComponents": [] @@ -2025,7 +2038,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 109 }, "propertyPath": [ "_name" @@ -2041,7 +2054,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 109 }, "propertyPath": [ "_lpos" @@ -2056,7 +2069,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 109 }, "propertyPath": [ "_lrot" @@ -2072,7 +2085,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 109 }, "propertyPath": [ "_euler" @@ -2090,11 +2103,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 103 + "__id__": 104 }, "_enabled": true, "__prefab": { - "__id__": 113 + "__id__": 114 }, "_contentSize": { "__type__": "cc.Size", @@ -2118,11 +2131,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 103 + "__id__": 104 }, "_enabled": false, "__prefab": { - "__id__": 115 + "__id__": 116 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2176,27 +2189,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 78 + "__id__": 79 }, "_children": [ { - "__id__": 118 + "__id__": 119 }, { - "__id__": 135 + "__id__": 136 } ], "_active": true, "_components": [ { - "__id__": 152 + "__id__": 153 }, { - "__id__": 154 + "__id__": 155 } ], "_prefab": { - "__id__": 156 + "__id__": 157 }, "_lpos": { "__type__": "cc.Vec3", @@ -2233,27 +2246,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 117 + "__id__": 118 }, "_children": [ { - "__id__": 119 + "__id__": 120 } ], "_active": true, "_components": [ { - "__id__": 127 + "__id__": 128 }, { - "__id__": 129 + "__id__": 130 }, { - "__id__": 131 + "__id__": 132 } ], "_prefab": { - "__id__": 134 + "__id__": 135 }, "_lpos": { "__type__": "cc.Vec3", @@ -2290,23 +2303,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 118 + "__id__": 119 }, "_children": [], "_active": true, "_components": [ { - "__id__": 120 + "__id__": 121 }, { - "__id__": 122 + "__id__": 123 }, { - "__id__": 124 + "__id__": 125 } ], "_prefab": { - "__id__": 126 + "__id__": 127 }, "_lpos": { "__type__": "cc.Vec3", @@ -2343,11 +2356,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 120 }, "_enabled": true, "__prefab": { - "__id__": 121 + "__id__": 122 }, "_contentSize": { "__type__": "cc.Size", @@ -2371,11 +2384,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 120 }, "_enabled": true, "__prefab": { - "__id__": 123 + "__id__": 124 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2416,11 +2429,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 120 }, "_enabled": true, "__prefab": { - "__id__": 125 + "__id__": 126 }, "_color": { "__type__": "cc.Color", @@ -2455,11 +2468,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 119 }, "_enabled": true, "__prefab": { - "__id__": 128 + "__id__": 129 }, "_contentSize": { "__type__": "cc.Size", @@ -2483,11 +2496,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 119 }, "_enabled": true, "__prefab": { - "__id__": 130 + "__id__": 131 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2528,15 +2541,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 119 }, "_enabled": true, "__prefab": { - "__id__": 132 + "__id__": 133 }, "clickEvents": [ { - "__id__": 133 + "__id__": 134 } ], "_interactable": true, @@ -2588,7 +2601,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 118 + "__id__": 119 }, "_id": "" }, @@ -2625,27 +2638,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 117 + "__id__": 118 }, "_children": [ { - "__id__": 136 + "__id__": 137 } ], "_active": true, "_components": [ { - "__id__": 144 + "__id__": 145 }, { - "__id__": 146 + "__id__": 147 }, { - "__id__": 148 + "__id__": 149 } ], "_prefab": { - "__id__": 151 + "__id__": 152 }, "_lpos": { "__type__": "cc.Vec3", @@ -2682,23 +2695,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 135 + "__id__": 136 }, "_children": [], "_active": true, "_components": [ { - "__id__": 137 + "__id__": 138 }, { - "__id__": 139 + "__id__": 140 }, { - "__id__": 141 + "__id__": 142 } ], "_prefab": { - "__id__": 143 + "__id__": 144 }, "_lpos": { "__type__": "cc.Vec3", @@ -2735,11 +2748,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 136 + "__id__": 137 }, "_enabled": true, "__prefab": { - "__id__": 138 + "__id__": 139 }, "_contentSize": { "__type__": "cc.Size", @@ -2763,11 +2776,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 136 + "__id__": 137 }, "_enabled": true, "__prefab": { - "__id__": 140 + "__id__": 141 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2808,11 +2821,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 136 + "__id__": 137 }, "_enabled": true, "__prefab": { - "__id__": 142 + "__id__": 143 }, "_color": { "__type__": "cc.Color", @@ -2847,11 +2860,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 135 + "__id__": 136 }, "_enabled": true, "__prefab": { - "__id__": 145 + "__id__": 146 }, "_contentSize": { "__type__": "cc.Size", @@ -2875,11 +2888,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 135 + "__id__": 136 }, "_enabled": true, "__prefab": { - "__id__": 147 + "__id__": 148 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2920,15 +2933,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 135 + "__id__": 136 }, "_enabled": true, "__prefab": { - "__id__": 149 + "__id__": 150 }, "clickEvents": [ { - "__id__": 150 + "__id__": 151 } ], "_interactable": true, @@ -2980,7 +2993,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 135 + "__id__": 136 }, "_id": "" }, @@ -3017,11 +3030,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 118 }, "_enabled": true, "__prefab": { - "__id__": 153 + "__id__": 154 }, "_contentSize": { "__type__": "cc.Size", @@ -3045,11 +3058,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 118 }, "_enabled": true, "__prefab": { - "__id__": 155 + "__id__": 156 }, "_resizeMode": 1, "_layoutType": 2, @@ -3096,11 +3109,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 158 + "__id__": 159 }, "_contentSize": { "__type__": "cc.Size", @@ -3124,11 +3137,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 160 + "__id__": 161 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3169,11 +3182,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 162 + "__id__": 163 }, "_alignFlags": 44, "_target": null, @@ -3222,26 +3235,26 @@ }, "_children": [ { - "__id__": 165 + "__id__": 166 } ], "_active": true, "_components": [ { - "__id__": 173 + "__id__": 174 }, { - "__id__": 175 + "__id__": 176 }, { - "__id__": 177 + "__id__": 178 }, { - "__id__": 179 + "__id__": 180 } ], "_prefab": { - "__id__": 182 + "__id__": 183 }, "_lpos": { "__type__": "cc.Vec3", @@ -3278,23 +3291,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 164 + "__id__": 165 }, "_children": [], "_active": true, "_components": [ { - "__id__": 166 + "__id__": 167 }, { - "__id__": 168 + "__id__": 169 }, { - "__id__": 170 + "__id__": 171 } ], "_prefab": { - "__id__": 172 + "__id__": 173 }, "_lpos": { "__type__": "cc.Vec3", @@ -3331,11 +3344,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 165 + "__id__": 166 }, "_enabled": true, "__prefab": { - "__id__": 167 + "__id__": 168 }, "_contentSize": { "__type__": "cc.Size", @@ -3359,11 +3372,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 165 + "__id__": 166 }, "_enabled": true, "__prefab": { - "__id__": 169 + "__id__": 170 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3404,11 +3417,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 165 + "__id__": 166 }, "_enabled": true, "__prefab": { - "__id__": 171 + "__id__": 172 }, "_color": { "__type__": "cc.Color", @@ -3443,11 +3456,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 164 + "__id__": 165 }, "_enabled": true, "__prefab": { - "__id__": 174 + "__id__": 175 }, "_contentSize": { "__type__": "cc.Size", @@ -3471,11 +3484,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 164 + "__id__": 165 }, "_enabled": true, "__prefab": { - "__id__": 176 + "__id__": 177 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3516,11 +3529,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 164 + "__id__": 165 }, "_enabled": true, "__prefab": { - "__id__": 178 + "__id__": 179 }, "_alignFlags": 44, "_target": null, @@ -3552,15 +3565,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 164 + "__id__": 165 }, "_enabled": true, "__prefab": { - "__id__": 180 + "__id__": 181 }, "clickEvents": [ { - "__id__": 181 + "__id__": 182 } ], "_interactable": true, @@ -3639,23 +3652,23 @@ }, "_children": [ { - "__id__": 184 + "__id__": 185 } ], "_active": true, "_components": [ { - "__id__": 190 + "__id__": 191 }, { - "__id__": 192 + "__id__": 193 }, { - "__id__": 194 + "__id__": 195 } ], "_prefab": { - "__id__": 197 + "__id__": 198 }, "_lpos": { "__type__": "cc.Vec3", @@ -3692,20 +3705,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 183 + "__id__": 184 }, "_children": [], "_active": true, "_components": [ { - "__id__": 185 + "__id__": 186 }, { - "__id__": 187 + "__id__": 188 } ], "_prefab": { - "__id__": 189 + "__id__": 190 }, "_lpos": { "__type__": "cc.Vec3", @@ -3742,11 +3755,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 185 }, "_enabled": true, "__prefab": { - "__id__": 186 + "__id__": 187 }, "_contentSize": { "__type__": "cc.Size", @@ -3770,11 +3783,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 185 }, "_enabled": true, "__prefab": { - "__id__": 188 + "__id__": 189 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3828,11 +3841,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 183 + "__id__": 184 }, "_enabled": true, "__prefab": { - "__id__": 191 + "__id__": 192 }, "_contentSize": { "__type__": "cc.Size", @@ -3856,11 +3869,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 183 + "__id__": 184 }, "_enabled": true, "__prefab": { - "__id__": 193 + "__id__": 194 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3901,15 +3914,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 183 + "__id__": 184 }, "_enabled": true, "__prefab": { - "__id__": 195 + "__id__": 196 }, "clickEvents": [ { - "__id__": 196 + "__id__": 197 } ], "_interactable": true, @@ -3961,7 +3974,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 183 + "__id__": 184 }, "_id": "" }, @@ -4002,23 +4015,23 @@ }, "_children": [ { - "__id__": 199 + "__id__": 200 } ], "_active": true, "_components": [ { - "__id__": 205 + "__id__": 206 }, { - "__id__": 207 + "__id__": 208 }, { - "__id__": 209 + "__id__": 210 } ], "_prefab": { - "__id__": 212 + "__id__": 213 }, "_lpos": { "__type__": "cc.Vec3", @@ -4055,20 +4068,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 198 + "__id__": 199 }, "_children": [], "_active": true, "_components": [ { - "__id__": 200 + "__id__": 201 }, { - "__id__": 202 + "__id__": 203 } ], "_prefab": { - "__id__": 204 + "__id__": 205 }, "_lpos": { "__type__": "cc.Vec3", @@ -4105,11 +4118,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 199 + "__id__": 200 }, "_enabled": true, "__prefab": { - "__id__": 201 + "__id__": 202 }, "_contentSize": { "__type__": "cc.Size", @@ -4133,11 +4146,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 199 + "__id__": 200 }, "_enabled": true, "__prefab": { - "__id__": 203 + "__id__": 204 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4191,11 +4204,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 198 + "__id__": 199 }, "_enabled": true, "__prefab": { - "__id__": 206 + "__id__": 207 }, "_contentSize": { "__type__": "cc.Size", @@ -4219,11 +4232,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 198 + "__id__": 199 }, "_enabled": true, "__prefab": { - "__id__": 208 + "__id__": 209 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4264,15 +4277,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 198 + "__id__": 199 }, "_enabled": true, "__prefab": { - "__id__": 210 + "__id__": 211 }, "clickEvents": [ { - "__id__": 211 + "__id__": 212 } ], "_interactable": true, @@ -4324,7 +4337,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 198 + "__id__": 199 }, "_id": "" }, @@ -4365,7 +4378,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 214 + "__id__": 215 }, "_contentSize": { "__type__": "cc.Size", @@ -4393,7 +4406,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 216 + "__id__": 217 }, "_alignFlags": 45, "_target": null, @@ -4429,13 +4442,13 @@ }, "_enabled": true, "__prefab": { - "__id__": 218 + "__id__": 219 }, "mask": false, "maskOpcity": 80, "isClickMaskeClose": false, "playerNameLabel": { - "__id__": 30 + "__id__": 31 }, "_id": "" }, @@ -4456,13 +4469,13 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": [ { - "__id__": 104 + "__id__": 105 }, { - "__id__": 79 + "__id__": 80 }, { - "__id__": 42 + "__id__": 43 }, { "__id__": 11 diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index 05386a0d..bc51dbe3 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -30,10 +30,10 @@ import { Component } from "cc"; // let APIPath = `http://localhost:8080` // let WsPath = `ws://localhost:8080/websocket` -let APIPath = `http://192.168.1.23:8080` -let WsPath = `ws://192.168.1.23:8080/websocket` -// let APIPath = `http://192.168.0.113:8080` -// let WsPath = `ws://192.168.0.113:8080/websocket` +// let APIPath = `http://192.168.1.23:8080` +// let WsPath = `ws://192.168.1.23:8080/websocket` +let APIPath = `http://192.168.0.128:8080` +let WsPath = `ws://192.168.0.128:8080/websocket` // let APIPath = `https://api.pet.jisol.cn` // let WsPath = `wss://api.pet.jisol.cn/websocket` @@ -148,7 +148,7 @@ export class JLoaderBattle extends JLoaderSystem{ //资源 resources:{[id:number]:Asset} = {}; - foreverResources:number[] = []; //永久资源Id + battleResources:number[] = []; //战斗资源Id async onInit(): Promise { @@ -161,28 +161,28 @@ export class JLoaderBattle extends JLoaderSystem{ app.loading.setCurrent(JLoaderBattle.loadingInit); //默认加载全部资源 - await this.loadForeverResources(...TD.TbBattleResource.getDataList()); + await this.loadBattleResources(...TD.TbBattleResource.getDataList()); app.loading.ok(JLoaderBattle.loadingInit); } - //加载永久资源 - async loadForeverResources(...ress:TB.TbBattleResource[]){ + //加载战斗资源 + async loadBattleResources(...ress:TB.TbBattleResource[]){ for (const res of ress) { - await this.loadForeverResource(res); + await this.loadBattleResource(res); } } - //加载永久资源 - loadForeverResource(res:TB.TbBattleResource){ + //加载战斗资源 + loadBattleResource(res:TB.TbBattleResource){ return (new Promise(r => { let Type:new ()=>Asset = [sp.SkeletonData,SpriteFrame][res.type]; this.bundle.load(res.path,Type,(error,data) => { - if(this.foreverResources.indexOf(res.id) < 0){ + if(this.battleResources.indexOf(res.id) < 0){ //添加永久资源 this.resources[res.id] = data; data.addRef(); @@ -213,14 +213,14 @@ export class JLoaderBattle extends JLoaderSystem{ })) } - //销毁永久资源 - clearForeverResources(...ress:TB.TbBattleResource[]){ - this.foreverResources.forEach(id => { + //销毁长久资源 + clearBattleResources(...ress:TB.TbBattleResource[]){ + this.battleResources.forEach(id => { if(this.resources[id]){ this.resources[id].decRef(); } }); - this.foreverResources = []; + this.battleResources = []; this.onUpdateResources(); } diff --git a/JisolGameCocos/assets/script/battle/GBattleModeManager.ts b/JisolGameCocos/assets/script/battle/GBattleModeManager.ts index 8b8a54c6..f485de40 100644 --- a/JisolGameCocos/assets/script/battle/GBattleModeManager.ts +++ b/JisolGameCocos/assets/script/battle/GBattleModeManager.ts @@ -4,10 +4,12 @@ import { Camera } from "cc"; import GBaseMode from "./GBaseMode"; import { Node } from "cc"; import { instantiate } from "cc"; -import { app } from "../App"; +import { TD, app } from "../App"; import { JNFrameInfo, JNSyncFrameEvent } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame"; import { CCObject } from "cc"; import { Env, EnvCurrent } from "../Env"; +import { TB } from "../../resources/config/data/schema"; +import BattleResource from "../tools/BattleResource"; export enum BattleMode{ //无尽模式 @@ -26,6 +28,8 @@ export interface GBattleModeInfo{ export enum GBattleModeEvent{ //关闭模式 Close = "GBattleModeEvent_Close", + StartLoadingResource = "GBattleModeEvent_StartLoadingResource", + EndLoadingResource = "GBattleModeEvent_EndLoadingResource", } //全局战斗模式管理器 @@ -61,6 +65,12 @@ export default class GBattleModeManager extends Singleton { //模式数据 data:any; + //是否加载资源 + isLoadingResource:boolean = false; + + //加载index + loadingIndex:number = 0; + //初始化管理器 async onInit(info:GBattleModeInfo){ @@ -77,8 +87,13 @@ export default class GBattleModeManager extends Singleton { } //打开指定模式 + // isAuto 是否自动推帧 + // data 模式数据 + // res 资源加载列表 (因为是帧同步所以打开模式前必须提前加载可能使用的资源) async Open(mode:BattleMode = null,isAuto:boolean = false,data:any = this.data){ + this.Close(); + this.data = data; if(!this.current && mode == null){ @@ -89,10 +104,25 @@ export default class GBattleModeManager extends Singleton { }else if(mode == null){ return; } - this.current = mode; this.setAuto(isAuto); + //加载资源 + let loadingIndex = (this.loadingIndex+=1); + this.isLoadingResource = true; + app.event.emit(GBattleModeEvent.StartLoadingResource); + console.log("[GBattleModeManager] 加载资源"); + await BattleResource.loadResource(mode,data); + console.log("[GBattleModeManager] 加载结束",loadingIndex,this.loadingIndex); + if(this.loadingIndex == loadingIndex){ + this.isLoadingResource = false; + app.event.emit(GBattleModeEvent.EndLoadingResource); + }else{ + //如果加载中途切换了模式则直接返回 + return; + } + + //资源加载完成则显示世界 app.sync.onReset(); app.sync.onStart(); diff --git a/JisolGameCocos/assets/script/tools/BattleResource.ts b/JisolGameCocos/assets/script/tools/BattleResource.ts new file mode 100644 index 00000000..bf3696e3 --- /dev/null +++ b/JisolGameCocos/assets/script/tools/BattleResource.ts @@ -0,0 +1,26 @@ +import { TB } from "../../resources/config/data/schema"; +import { TD, app } from "../App"; +import { BattleMode } from "../battle/GBattleModeManager"; + + +export default class BattleResource { + + //根据参数获取可能加载的资源 + static getResources(mode:BattleMode,data:any):TB.TbBattleResource[]{ + switch(mode){ + default: + return TD.TbBattleResource.getDataList(); + } + } + + //加载资源 + static async loadResource(mode:BattleMode,data:any){ + + let resources = this.getResources(mode,data); + //加载资源 + await app.battleRes.loadBattleResources(...resources); + + } + +} + diff --git a/JisolGameCocos/assets/script/tools/BattleResource.ts.meta b/JisolGameCocos/assets/script/tools/BattleResource.ts.meta new file mode 100644 index 00000000..ff41eef5 --- /dev/null +++ b/JisolGameCocos/assets/script/tools/BattleResource.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "d90fa0e9-c8d6-44f4-aad2-41aac59b7e59", + "files": [], + "subMetas": {}, + "userData": {} +}