diff --git a/DataTables/Datas/战斗/地图.xlsx b/DataTables/Datas/战斗/地图.xlsx index 58148355..171700f0 100644 Binary files a/DataTables/Datas/战斗/地图.xlsx and b/DataTables/Datas/战斗/地图.xlsx differ diff --git a/JisolGameCocos/assets/res/UI/MainView.meta b/JisolGameCocos/assets/res/UI/MainView.meta new file mode 100644 index 00000000..3537189a --- /dev/null +++ b/JisolGameCocos/assets/res/UI/MainView.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "6d20ceb6-cbb6-47af-a9c0-dce5d2126b18", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/res/UI/MainView/MAP6_3.png b/JisolGameCocos/assets/res/UI/MainView/MAP6_3.png new file mode 100644 index 00000000..2082bb88 Binary files /dev/null and b/JisolGameCocos/assets/res/UI/MainView/MAP6_3.png differ diff --git a/JisolGameCocos/assets/res/UI/MainView/MAP6_3.png.meta b/JisolGameCocos/assets/res/UI/MainView/MAP6_3.png.meta new file mode 100644 index 00000000..8f3688c3 --- /dev/null +++ b/JisolGameCocos/assets/res/UI/MainView/MAP6_3.png.meta @@ -0,0 +1,134 @@ +{ + "ver": "1.0.26", + "importer": "image", + "imported": true, + "uuid": "e853b2e8-b538-47a2-aa86-ba4d2cec600d", + "files": [ + ".json", + ".png" + ], + "subMetas": { + "6c48a": { + "importer": "texture", + "uuid": "e853b2e8-b538-47a2-aa86-ba4d2cec600d@6c48a", + "displayName": "MAP6_3", + "id": "6c48a", + "name": "texture", + "userData": { + "wrapModeS": "repeat", + "wrapModeT": "repeat", + "minfilter": "linear", + "magfilter": "linear", + "mipfilter": "none", + "anisotropy": 0, + "isUuid": true, + "imageUuidOrDatabaseUri": "e853b2e8-b538-47a2-aa86-ba4d2cec600d", + "visible": false + }, + "ver": "1.0.22", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + }, + "f9941": { + "importer": "sprite-frame", + "uuid": "e853b2e8-b538-47a2-aa86-ba4d2cec600d@f9941", + "displayName": "MAP6_3", + "id": "f9941", + "name": "spriteFrame", + "userData": { + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 24, + "height": 24, + "rawWidth": 24, + "rawHeight": 24, + "borderTop": 11, + "borderBottom": 11, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [ + -12, + -12, + 0, + 12, + -12, + 0, + -12, + 12, + 0, + 12, + 12, + 0 + ], + "indexes": [ + 0, + 1, + 2, + 2, + 1, + 3 + ], + "uv": [ + 0, + 24, + 24, + 24, + 0, + 0, + 24, + 0 + ], + "nuv": [ + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 1 + ], + "minPos": [ + -12, + -12, + 0 + ], + "maxPos": [ + 12, + 12, + 0 + ] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "e853b2e8-b538-47a2-aa86-ba4d2cec600d@6c48a", + "atlasUuid": "" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + } + }, + "userData": { + "fixAlphaTransparencyArtifacts": false, + "hasAlpha": false, + "type": "sprite-frame", + "redirect": "e853b2e8-b538-47a2-aa86-ba4d2cec600d@f9941" + } +} diff --git a/JisolGameCocos/assets/resources/WorldCanvas.prefab b/JisolGameCocos/assets/resources/WorldCanvas.prefab index 47706ef4..1b739e91 100644 --- a/JisolGameCocos/assets/resources/WorldCanvas.prefab +++ b/JisolGameCocos/assets/resources/WorldCanvas.prefab @@ -132,7 +132,7 @@ "_priority": 0, "_fov": 45, "_fovAxis": 0, - "_orthoHeight": 640, + "_orthoHeight": 1000, "_near": 0, "_far": 1000, "_color": { @@ -340,13 +340,13 @@ "camera": { "__id__": 3 }, - "prefabs": [ + "modes": [ { - "__uuid__": "b882ecdb-012a-4d85-b799-e4da5991c0dd", + "__uuid__": "3520eceb-6d73-4cdc-b333-c80f737fee27", "__expectedType__": "cc.Prefab" }, { - "__uuid__": "3520eceb-6d73-4cdc-b333-c80f737fee27", + "__uuid__": "b882ecdb-012a-4d85-b799-e4da5991c0dd", "__expectedType__": "cc.Prefab" } ], diff --git a/JisolGameCocos/assets/resources/config/data/schema.ts b/JisolGameCocos/assets/resources/config/data/schema.ts index cf8adac1..c0c46026 100644 --- a/JisolGameCocos/assets/resources/config/data/schema.ts +++ b/JisolGameCocos/assets/resources/config/data/schema.ts @@ -227,6 +227,8 @@ export class TbGMap { this.map2OffsetY = _json_.map2OffsetY if (_json_.map3OffsetY === undefined) { throw new Error() } this.map3OffsetY = _json_.map3OffsetY + if (_json_.scale === undefined) { throw new Error() } + this.scale = _json_.scale } /** @@ -261,6 +263,10 @@ export class TbGMap { * 地图2(后) 偏移量Y */ readonly map3OffsetY: number + /** + * 地图缩放 + */ + readonly scale: number resolve(tables:Tables) { diff --git a/JisolGameCocos/assets/resources/config/json/tbgmap.json b/JisolGameCocos/assets/resources/config/json/tbgmap.json index bc23d3ff..3caec599 100644 --- a/JisolGameCocos/assets/resources/config/json/tbgmap.json +++ b/JisolGameCocos/assets/resources/config/json/tbgmap.json @@ -5,8 +5,9 @@ "map1": "map/MAP6/MAP6_1/spriteFrame", "map2": "map/MAP6/MAP6_2/spriteFrame", "map3": "map/MAP6/MAP6_3/spriteFrame", - "map1OffsetY": 100, - "map2OffsetY": 400, - "map3OffsetY": 400 + "map1OffsetY": 80, + "map2OffsetY": 520, + "map3OffsetY": 520, + "scale": 1.5 } ] \ No newline at end of file diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab index 855bf156..add71919 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab @@ -23,22 +23,34 @@ }, { "__id__": 10 + }, + { + "__id__": 38 + }, + { + "__id__": 46 + }, + { + "__id__": 65 + }, + { + "__id__": 80 } ], "_active": true, "_components": [ { - "__id__": 29 + "__id__": 95 }, { - "__id__": 31 + "__id__": 97 }, { - "__id__": 33 + "__id__": 99 } ], "_prefab": { - "__id__": 35 + "__id__": 101 }, "_lpos": { "__type__": "cc.Vec3", @@ -246,7 +258,7 @@ }, { "__type__": "cc.Node", - "_name": "聊天框", + "_name": "游戏区域", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -255,30 +267,27 @@ "_children": [ { "__id__": 11 + }, + { + "__id__": 17 } ], "_active": true, "_components": [ { - "__id__": 19 + "__id__": 33 }, { - "__id__": 21 - }, - { - "__id__": 23 - }, - { - "__id__": 25 + "__id__": 35 } ], "_prefab": { - "__id__": 28 + "__id__": 37 }, "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": -590, + "y": 60, "z": 0 }, "_lrot": { @@ -306,7 +315,7 @@ }, { "__type__": "cc.Node", - "_name": "Label", + "_name": "WorldCamera", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -320,13 +329,10 @@ }, { "__id__": 14 - }, - { - "__id__": 16 } ], "_prefab": { - "__id__": 18 + "__id__": 16 }, "_lpos": { "__type__": "cc.Vec3", @@ -369,6 +375,801 @@ "__prefab": { "__id__": 13 }, + "_contentSize": { + "__type__": "cc.Size", + "width": 720, + "height": 1280 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "61k/3xmdtHe6Srw0droR6G" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 11 + }, + "_enabled": true, + "__prefab": { + "__id__": 15 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "a0d1e275-5512-493e-8e15-7d2db8beb48e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "eb9IOPTBFJjLwXgqVCKLbC" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "64PJYFWgBDZrEsaiYwZxmh", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "玩家信息", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 10 + }, + "_children": [ + { + "__id__": 18 + } + ], + "_active": true, + "_components": [ + { + "__id__": 26 + }, + { + "__id__": 28 + }, + { + "__id__": 30 + } + ], + "_prefab": { + "__id__": 32 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -240, + "y": 520, + "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": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 17 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 19 + }, + { + "__id__": 21 + }, + { + "__id__": 23 + } + ], + "_prefab": { + "__id__": 25 + }, + "_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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_enabled": true, + "__prefab": { + "__id__": 20 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 124, + "height": 54.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "472EPuIi5BQbqoiwp5FAVj" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_enabled": true, + "__prefab": { + "__id__": 22 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "玩家名称", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 30, + "_fontSize": 30, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": true, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "ffPWIt2utPFK9mn7wky8+L" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_enabled": true, + "__prefab": { + "__id__": 24 + }, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 2, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "39Qp34Lr5Pwq9oR6o59B5C" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "daL9kFUXJBAJkj9cOemdUw", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": { + "__id__": 27 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 80 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "e9rBw2jx1IiJEwcWsaXui9" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": { + "__id__": 29 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 235, + "g": 235, + "b": 235, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__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": "7cJYuG4m5LGJXk3KiyrGeb" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": { + "__id__": 31 + }, + "_alignFlags": 9, + "_target": null, + "_left": 20, + "_right": 0, + "_top": 20, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "9cDjiZptREL6KKSKrTqdhL" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "fdayH6FM5D7KxxkfPBzFJ/", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": { + "__id__": 34 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 720, + "height": 580 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2eI6VJ1M5H64U8vUZ7lX2A" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": { + "__id__": 36 + }, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 700, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 100, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "1096TwrPFP14XtPNWaGklG" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "29F6ackXlKUqq2ybGz+eqX", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "控制区域", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 39 + }, + { + "__id__": 41 + }, + { + "__id__": 43 + } + ], + "_prefab": { + "__id__": 45 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -240, + "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__": 38 + }, + "_enabled": true, + "__prefab": { + "__id__": 40 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 720, + "height": 600 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "97jRvdTqBGm4gln85RWk4S" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 38 + }, + "_enabled": true, + "__prefab": { + "__id__": 42 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 226, + "g": 226, + "b": 226, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__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": "25QnSNv7VP14czhZ5MltEA" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 38 + }, + "_enabled": true, + "__prefab": { + "__id__": 44 + }, + "_alignFlags": 44, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 1080, + "_bottom": 100, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 100, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "eaPARM7blDbZ2uSHiinyXS" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "54h7JjlKpP0oEThupO7+XD", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "聊天框", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 47 + } + ], + "_active": true, + "_components": [ + { + "__id__": 55 + }, + { + "__id__": 57 + }, + { + "__id__": 59 + }, + { + "__id__": 61 + } + ], + "_prefab": { + "__id__": 64 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -590, + "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": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 46 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 48 + }, + { + "__id__": 50 + }, + { + "__id__": 52 + } + ], + "_prefab": { + "__id__": 54 + }, + "_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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 47 + }, + "_enabled": true, + "__prefab": { + "__id__": 49 + }, "_contentSize": { "__type__": "cc.Size", "width": 294, @@ -391,11 +1192,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 11 + "__id__": 47 }, "_enabled": true, "__prefab": { - "__id__": 15 + "__id__": 51 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -436,11 +1237,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 11 + "__id__": 47 }, "_enabled": true, "__prefab": { - "__id__": 17 + "__id__": 53 }, "_color": { "__type__": "cc.Color", @@ -475,11 +1276,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 46 }, "_enabled": true, "__prefab": { - "__id__": 20 + "__id__": 56 }, "_contentSize": { "__type__": "cc.Size", @@ -503,11 +1304,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 46 }, "_enabled": true, "__prefab": { - "__id__": 22 + "__id__": 58 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -548,11 +1349,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 46 }, "_enabled": true, "__prefab": { - "__id__": 24 + "__id__": 60 }, "_alignFlags": 44, "_target": null, @@ -584,15 +1385,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 46 }, "_enabled": true, "__prefab": { - "__id__": 26 + "__id__": 62 }, "clickEvents": [ { - "__id__": 27 + "__id__": 63 } ], "_interactable": true, @@ -661,6 +1462,732 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_name": "Button", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 66 + } + ], + "_active": true, + "_components": [ + { + "__id__": 72 + }, + { + "__id__": 74 + }, + { + "__id__": 76 + } + ], + "_prefab": { + "__id__": 79 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 279.236, + "y": 587.407, + "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": "Label", + "_objFlags": 512, + "__editorExtras__": {}, + "_parent": { + "__id__": 65 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 67 + }, + { + "__id__": 69 + } + ], + "_prefab": { + "__id__": 71 + }, + "_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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 66 + }, + "_enabled": true, + "__prefab": { + "__id__": 68 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "295FJgqrlID7+EM3GmajI1" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 66 + }, + "_enabled": true, + "__prefab": { + "__id__": 70 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_string": "button", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 20, + "_fontSize": 20, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d78KXR8/BE9IlqhJatmbX2" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "786qjkRnhJRpQ7Q9gAl6IV", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 65 + }, + "_enabled": true, + "__prefab": { + "__id__": 73 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "51h2LQ2vNMV4JpEi7g01aZ" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 65 + }, + "_enabled": true, + "__prefab": { + "__id__": 75 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@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": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d8rnA//K9Fn4rzLgVZZy5b" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 65 + }, + "_enabled": true, + "__prefab": { + "__id__": 77 + }, + "clickEvents": [ + { + "__id__": 78 + } + ], + "_interactable": true, + "_transition": 2, + "_normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_hoverSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_pressedSprite": { + "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_disabledSprite": { + "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 65 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "107xV2OVpNTor7W8en2vF7" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "b51bfKvsidNPKBbFirAFgQI", + "handler": "onOpenDemo", + "customEventData": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "83fgzFEQJO+6c4/L3Y/adf", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "Button-001", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 81 + } + ], + "_active": true, + "_components": [ + { + "__id__": 87 + }, + { + "__id__": 89 + }, + { + "__id__": 91 + } + ], + "_prefab": { + "__id__": 94 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 165.073, + "y": 587.407, + "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": "Label", + "_objFlags": 512, + "__editorExtras__": {}, + "_parent": { + "__id__": 80 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 82 + }, + { + "__id__": 84 + } + ], + "_prefab": { + "__id__": 86 + }, + "_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": 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": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "edlBw6qthJVaj/Jw5F1VlJ" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 81 + }, + "_enabled": true, + "__prefab": { + "__id__": 85 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_string": "button", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 20, + "_fontSize": 20, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "c2ch8VomJJI56sruDdgnhr" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "df48QMeDhBr65Sk2KF9u8/", + "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": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "76rH/uJ59PB6JH7eExn9T+" + }, + { + "__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__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@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": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "11YtsicrhDoaONMq1d7iEv" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 80 + }, + "_enabled": true, + "__prefab": { + "__id__": 92 + }, + "clickEvents": [ + { + "__id__": 93 + } + ], + "_interactable": true, + "_transition": 2, + "_normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_hoverSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_pressedSprite": { + "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_disabledSprite": { + "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 80 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "065+/ndM9NBJumAyXAxxgE" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "b51bfKvsidNPKBbFirAFgQI", + "handler": "onOpenOnHook", + "customEventData": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "57lU3jCIBFmYBvRXLhkAzw", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", @@ -671,7 +2198,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 30 + "__id__": 96 }, "_contentSize": { "__type__": "cc.Size", @@ -699,7 +2226,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 32 + "__id__": 98 }, "_alignFlags": 45, "_target": null, @@ -735,10 +2262,14 @@ }, "_enabled": true, "__prefab": { - "__id__": 34 + "__id__": 100 }, "mask": false, "maskOpcity": 80, + "isClickMaskeClose": false, + "playerNameLabel": { + "__id__": 21 + }, "_id": "" }, { diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/子组件.meta b/JisolGameCocos/assets/resources/prefab/ui/主页/子组件.meta new file mode 100644 index 00000000..eb020c52 --- /dev/null +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/子组件.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "67d033d1-2622-4892-90d0-9f84830803fd", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/聊天/MainChatView.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/聊天/MainChatView.prefab index 6475d242..c5d7c566 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/聊天/MainChatView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/聊天/MainChatView.prefab @@ -2064,7 +2064,7 @@ }, "_inputFlag": 5, "_inputMode": 6, - "_maxLength": 8, + "_maxLength": 100, "_id": "" }, { diff --git a/JisolGameCocos/assets/resources/renders/WorldCamera.rt b/JisolGameCocos/assets/resources/renders/WorldCamera.rt index 0176aea5..b018d3a5 100644 --- a/JisolGameCocos/assets/resources/renders/WorldCamera.rt +++ b/JisolGameCocos/assets/resources/renders/WorldCamera.rt @@ -3,7 +3,7 @@ "content": { "base": "2,2,0,0,0,0", "w": 720, - "h": 720, + "h": 1280, "n": "WorldCamera" } } \ No newline at end of file diff --git a/JisolGameCocos/assets/resources/renders/WorldCamera.rt.meta b/JisolGameCocos/assets/resources/renders/WorldCamera.rt.meta index 1df8de3d..c2f05ae4 100644 --- a/JisolGameCocos/assets/resources/renders/WorldCamera.rt.meta +++ b/JisolGameCocos/assets/resources/renders/WorldCamera.rt.meta @@ -16,7 +16,7 @@ "userData": { "imageUuidOrDatabaseUri": "a0d1e275-5512-493e-8e15-7d2db8beb48e", "width": 720, - "height": 720 + "height": 1280 }, "ver": "1.0.0", "imported": true, @@ -28,7 +28,7 @@ }, "userData": { "width": 720, - "height": 720, + "height": 1280, "anisotropy": 0, "minfilter": "linear", "magfilter": "linear", diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index 757b9aad..76eeac35 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -100,33 +100,6 @@ class JNGSyncFrame extends JNSyncFrame{ } -//重写UI Base -export class JNGLayerBase extends JNLayerBase{ - public close():void { - console.log("close"); - app.layer.CloseNode(this.node); - } -} - -//重写Sync Base -export class JNGSyncBase extends JNSyncFrameComponent{ - onSyncLoad() { } - onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) { } - protected getSync(): JNSyncFrame { - return app.sync - } - -} -//重写Sync Proto Base -export abstract class JNGSyncProtoBase extends JNSyncFrameProtoComponent{ - - onSyncLoad() { } - onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) { } - protected getSync(): JNSyncFrame { - return app.sync - } - -} export var TD:Tables = null; //读写config diff --git a/JisolGameCocos/assets/script/Main.ts b/JisolGameCocos/assets/script/Main.ts index 992b0e1e..93348395 100644 --- a/JisolGameCocos/assets/script/Main.ts +++ b/JisolGameCocos/assets/script/Main.ts @@ -21,11 +21,11 @@ export class Main extends Component { //加载 APP await JNGame.Init(app); - // //发生帧同步开始 - // app.socket.Send(JNSyncAction.NSyncFrameStart); + //发生帧同步开始 + app.socket.Send(JNSyncAction.NSyncFrameStart); - // // 创建世界 - // director.getScene().addChild(instantiate(this.WorldPrefab)); + // 创建世界 + director.getScene().addChild(instantiate(this.WorldPrefab)); } diff --git a/JisolGameCocos/assets/script/WorldCanvas.ts b/JisolGameCocos/assets/script/WorldCanvas.ts index 8f12b792..2acfb3c7 100644 --- a/JisolGameCocos/assets/script/WorldCanvas.ts +++ b/JisolGameCocos/assets/script/WorldCanvas.ts @@ -1,9 +1,6 @@ -import { _decorator, Component, instantiate, Node, Prefab } from 'cc'; -import { JNFrameInfo, JNSyncFrameEvent } from '../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame'; -import { app } from './App'; -import { JNSyncAction } from '../../extensions/ngame/assets/ngame/sync/JNSyncAction'; +import { _decorator, Component, Node, Prefab } from 'cc'; import { Camera } from 'cc'; -import GBaseMode from './battle/GBaseMode'; +import GBattleModeManager from './battle/GBattleModeManager'; const { ccclass, property } = _decorator; @ccclass('WorldCanvas') @@ -15,7 +12,7 @@ export class WorldCanvas extends Component { camera:Camera = null; @property([Prefab]) - prefabs:Prefab[] = []; + modes:Prefab[] = []; index:number = 1; @@ -24,40 +21,19 @@ export class WorldCanvas extends Component { //重置相机位置 this.camera.node.setWorldPosition(0,0,1000); - //监听帧同步 - app.event.on(JNSyncFrameEvent.CLEAR,this.clear,this); - app.event.on(JNSyncFrameEvent.CREATE,this.create,this); - - //监听帧回调 - app.socket.on(JNSyncAction.NSyncFrameBack,this.onFrameBack,this,"JNFrameInfo"); - - app.sync.onReset(); - app.sync.onStart(); - - } - - //清除世界 - clear(){ - this.root.removeAllChildren(); - } - - //创建世界 - create(){ - let world = instantiate(this.prefabs[this.index]); - world.getComponent(GBaseMode).camera = this.camera; - this.root.addChild(world) - this.scheduleOnce(() => { - app.sync.onStart(); + //初始化游戏模式管理器 + GBattleModeManager.getIns().onInit({ + modes:this.modes, //模式 + camera:this.camera, //相机 + root:this.root, //场景 }); + } update(deltaTime: number) { - app.sync.update(deltaTime); + GBattleModeManager.getIns().onUpdate(deltaTime); } - onFrameBack(info:JNFrameInfo){ - app.sync.addFrame(info,true); - } } diff --git a/JisolGameCocos/assets/script/battle/GBattleModeManager.ts b/JisolGameCocos/assets/script/battle/GBattleModeManager.ts index ae789b50..17cb1f65 100644 --- a/JisolGameCocos/assets/script/battle/GBattleModeManager.ts +++ b/JisolGameCocos/assets/script/battle/GBattleModeManager.ts @@ -1,14 +1,137 @@ +import { Prefab } from "cc"; import Singleton from "../../../extensions/ngame/assets/ngame/util/Singleton"; +import { Camera } from "cc"; +import GBaseMode from "./GBaseMode"; +import { Node } from "cc"; +import { instantiate } from "cc"; +import { app } from "../App"; +import { JNFrameInfo, JNSyncFrameEvent } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame"; export enum BattleMode{ + //无尽模式 + OnHook = 0, //PVP 模式 - PVP, + PVP = 1, +} + +export interface GBattleModeInfo{ + modes:Prefab[], //模式预制体 + camera:Camera, //场景相机 + root:Node, //世界场景Root } //全局战斗模式管理器 export default class GBattleModeManager extends Singleton { + //模式预制体 + modes:Prefab[] = []; + //场景相机 + camera:Camera; + //世界场景Root + root:Node; + + //是否初始化 + isInit:boolean = false; + + //当前模式 + current:BattleMode = null; + + //是否自动退帧 + isAuto:boolean = false; + + //自动推帧间隔 + autoTime:number = 0; + + //初始化管理器 + async onInit(info:GBattleModeInfo){ + + this.modes = info.modes || []; + this.camera = info.camera; + this.root = info.root; + + //监听帧同步 世界创建逻辑 + app.event.on(JNSyncFrameEvent.CLEAR,this.clear,this); + app.event.on(JNSyncFrameEvent.CREATE,this.create,this); + + this.isInit = true; + + } + + //打开指定模式 + async Open(mode:BattleMode,isAuto:boolean = false){ + + await this.Close(); + + this.current = mode; + this.setAuto(isAuto); + + app.sync.onReset(); + app.sync.onStart(); + + } + + //关闭当前模式 + async Close(){ + + //主动调用场景销毁 + app.sync.onReset(); + this.clear(); + this.current = null; + + } + + //设置自动推帧 ( 帧不由addFrame控制 管理器自动推帧) + setAuto(is:boolean){ + this.isAuto = is; + this.autoTime = 0; + } + + //清除当前模式 + private clear(){ + if(!this.isInit) return; + this.root.destroyAllChildren(); + } + + //创建当前模式 + private create(){ + if(!this.isInit || this.current == null) return; + let mode = instantiate(this.modes[this.current]); + mode.getComponent(GBaseMode).camera = this.camera; + this.root.addChild(mode) + + } + + //向场景推帧 + addFrame(info:JNFrameInfo){ + if(this.isAuto) return; //如果是自动推帧则返回 + app.sync.addFrame(info,true); + } + + //管理器更新 + onUpdate(dt:number){ + //更新帧同步 + app.sync.update(dt); + //自动推帧 + this.onAutoFrame(dt); + } + //自动推帧 + private onAutoFrame(dt:number){ + + if(!this.isAuto) return; + + this.autoTime += dt * 1000; + + //获取当前帧同步的帧数推空帧 + if(app.sync.nSyncTime < this.autoTime){ + //如果事件够则推帧 + this.autoTime -= app.sync.nSyncTime; + app.sync.addFrame({ + index:app.sync.nLocalFrame + 1 + }); + } + + } } diff --git a/JisolGameCocos/assets/script/battle/base/GObject.ts b/JisolGameCocos/assets/script/battle/base/GObject.ts index 5ca89d5c..aae2c9ab 100644 --- a/JisolGameCocos/assets/script/battle/base/GObject.ts +++ b/JisolGameCocos/assets/script/battle/base/GObject.ts @@ -1,7 +1,7 @@ import { Vec2 } from "cc"; -import { JNGSyncProtoBase } from "../../App"; import GBaseMode from "../GBaseMode"; import { v2 } from "cc"; +import { JNGSyncProtoBase } from "../../components/JNComponent"; export enum GTowards{ RIGHT,LEFT diff --git a/JisolGameCocos/assets/script/battle/base/common/map/GMapLoop.ts b/JisolGameCocos/assets/script/battle/base/common/map/GMapLoop.ts index 2cba8fdb..9686b665 100644 --- a/JisolGameCocos/assets/script/battle/base/common/map/GMapLoop.ts +++ b/JisolGameCocos/assets/script/battle/base/common/map/GMapLoop.ts @@ -1,11 +1,11 @@ import { _decorator, Component, Node } from 'cc'; -import { app, JNGSyncBase } from '../../../../App'; import { SpriteFrame } from 'cc'; import { Sprite } from 'cc'; import { UITransform } from 'cc'; import { v3 } from 'cc'; import { size } from 'cc'; import GNode from '../GNode'; +import { JNGSyncBase } from '../../../../components/JNComponent'; const { ccclass, property } = _decorator; /** diff --git a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts index fcc0aad9..182f6d1c 100644 --- a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts @@ -106,16 +106,19 @@ export default class GOnHookMode extends GBaseMode<{}>{ //调整相机 let camreaPos = this.camera.node.worldPosition; - this.camera.node.worldPosition = v3(0,100,camreaPos.z) + this.camera.node.worldPosition = v3(0,800,camreaPos.z) //初始化状态机 this.fsm = new GFSMOnHookMode(this); //初始化地图 this.mapInfo = TD.TbGMap.get(60001); - this.map1.init(app.battleRes.maps[60001][0],1); - this.map2.init(app.battleRes.maps[60001][1],1); - this.map3.init(app.battleRes.maps[60001][2],1,app.battleRes.maps[60001][1].width,app.battleRes.maps[60001][1].height); + + let scale = this.mapInfo.scale; + + this.map1.init(app.battleRes.maps[60001][0],1,app.battleRes.maps[60001][0].width * scale,app.battleRes.maps[60001][0].height * scale); + this.map2.init(app.battleRes.maps[60001][1],1,app.battleRes.maps[60001][1].width * scale,app.battleRes.maps[60001][1].height * scale); + this.map3.init(app.battleRes.maps[60001][2],1,app.battleRes.maps[60001][1].width * scale,1048 * scale); this.onUpdateMap(0); this.playerInfo = { tactical: GTactical.getTactical().setOffset(this.playerPos), roles: GRoleUtil.getGRoles([10004,10004,10004,10004,10003,10003]) }; diff --git a/JisolGameCocos/assets/script/components.meta b/JisolGameCocos/assets/script/components.meta new file mode 100644 index 00000000..c8a50075 --- /dev/null +++ b/JisolGameCocos/assets/script/components.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "2deea119-e5ca-4136-a47a-7c1e4f58421f", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/components/JNComponent.ts b/JisolGameCocos/assets/script/components/JNComponent.ts new file mode 100644 index 00000000..5617c055 --- /dev/null +++ b/JisolGameCocos/assets/script/components/JNComponent.ts @@ -0,0 +1,33 @@ +import JNSyncFrame, { JNFrameInfo } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame"; +import JNSyncFrameComponent from "../../../extensions/ngame/assets/ngame/sync/frame/game/JNSyncFrameComponent"; +import JNSyncFrameProtoComponent from "../../../extensions/ngame/assets/ngame/sync/frame/game/JNSyncFrameProtoComponent"; +import JNLayerBase from "../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase"; +import { app } from "../App"; + +//重写UI Base +export class JNGLayerBase extends JNLayerBase{ + public close():void { + console.log("close"); + app.layer.CloseNode(this.node); + } +} + +//重写Sync Base +export class JNGSyncBase extends JNSyncFrameComponent{ + onSyncLoad() { } + onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) { } + protected getSync(): JNSyncFrame { + return app.sync + } + +} +//重写Sync Proto Base +export abstract class JNGSyncProtoBase extends JNSyncFrameProtoComponent{ + + onSyncLoad() { } + onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) { } + protected getSync(): JNSyncFrame { + return app.sync + } + +} \ No newline at end of file diff --git a/JisolGameCocos/assets/script/components/JNComponent.ts.meta b/JisolGameCocos/assets/script/components/JNComponent.ts.meta new file mode 100644 index 00000000..fce2d370 --- /dev/null +++ b/JisolGameCocos/assets/script/components/JNComponent.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "1dcad6c8-dd7e-4d30-ad3d-2d98e1e9f48d", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/ui/Home/Chat/MainChatView.ts b/JisolGameCocos/assets/script/ui/Home/Chat/MainChatView.ts index edb1f104..66fa38e6 100644 --- a/JisolGameCocos/assets/script/ui/Home/Chat/MainChatView.ts +++ b/JisolGameCocos/assets/script/ui/Home/Chat/MainChatView.ts @@ -1,5 +1,4 @@ import { _decorator, Component, Node } from 'cc'; -import { app, JNGLayerBase } from '../../../App'; import { Prefab } from 'cc'; import ChatData from '../../../data/ChatData'; import { instantiate } from 'cc'; @@ -9,6 +8,8 @@ import { GUI } from '../../UIConfig'; import { GUIChatMessage } from '../../../consts/GActionType'; import { Widget } from 'cc'; import JScrollExceedHide from '../../../../../extensions/ngame/assets/ngame/util/components/JScrollExceedHide'; +import { JNGLayerBase } from '../../../components/JNComponent'; +import { app } from '../../../App'; const { ccclass, property } = _decorator; @ccclass('MainChatView') diff --git a/JisolGameCocos/assets/script/ui/Home/HomeView.ts b/JisolGameCocos/assets/script/ui/Home/HomeView.ts index c6f908c7..ec69587b 100644 --- a/JisolGameCocos/assets/script/ui/Home/HomeView.ts +++ b/JisolGameCocos/assets/script/ui/Home/HomeView.ts @@ -1,5 +1,4 @@ import { _decorator, Component, Label, Node } from 'cc'; -import { app, JNGLayerBase } from '../../App'; import { Toggle } from 'cc'; import { JNSyncAction } from '../../../../extensions/ngame/assets/ngame/sync/JNSyncAction'; import { director } from 'cc'; @@ -7,6 +6,8 @@ import { WorldCanvas } from '../../WorldCanvas'; import { StorageData, StorageEnum } from '../../consts/GData'; import { GUI } from '../UIConfig'; import { API } from '../../consts/API'; +import { JNGLayerBase } from '../../components/JNComponent'; +import { app } from '../../App'; const { ccclass, property } = _decorator; @ccclass('HomeView') diff --git a/JisolGameCocos/assets/script/ui/Home/MainView.ts b/JisolGameCocos/assets/script/ui/Home/MainView.ts index cf636312..2e45535a 100644 --- a/JisolGameCocos/assets/script/ui/Home/MainView.ts +++ b/JisolGameCocos/assets/script/ui/Home/MainView.ts @@ -1,21 +1,39 @@ import { _decorator, Component, Label, Node } from 'cc'; -import { app, JNGLayerBase } from '../../App'; import { GUI } from '../UIConfig'; import ChatData from '../../data/ChatData'; import PlayerData from '../../data/PlayerData'; +import GBattleModeManager, { BattleMode } from '../../battle/GBattleModeManager'; +import { JNGLayerBase } from '../../components/JNComponent'; +import { app } from '../../App'; const { ccclass, property } = _decorator; @ccclass('MainView') export class MainView extends JNGLayerBase { + @property(Label) + playerNameLabel:Label; //玩家名称 onJNLoad(data?: any): void { + //默认无限模式 + GBattleModeManager.getIns().Open(BattleMode.OnHook,true); + //发送消息 ChatData.getIns().onSend({ message:`${PlayerData.getIns().data.playerId} 加入游戏` }); + this.onUpdateView(); + } + + //更新UI界面 + onUpdateView(){ + this.playerNameLabel.string = PlayerData.getIns().getInfo().playerName; + } + + //打开Demo页面 + onOpenDemo(){ + app.layer.Open(GUI.Home); } //打开聊天页面 @@ -23,6 +41,11 @@ export class MainView extends JNGLayerBase { app.layer.Open(GUI.MainChat); } + //点击打开无限模式 + onOpenOnHook(){ + GBattleModeManager.getIns().Open(BattleMode.OnHook,true); + } + } diff --git a/JisolGameCocos/assets/script/ui/Loading/LoadingView.ts b/JisolGameCocos/assets/script/ui/Loading/LoadingView.ts index a9e782e5..db3f026e 100644 --- a/JisolGameCocos/assets/script/ui/Loading/LoadingView.ts +++ b/JisolGameCocos/assets/script/ui/Loading/LoadingView.ts @@ -1,9 +1,10 @@ import { ProgressBar } from "cc"; import { _decorator } from "cc"; -import { JNGLayerBase, app } from "../../App"; import { Label } from "cc"; import { GUI } from "../UIConfig"; import NoviceManager from "../../manager/NoviceManager"; +import { JNGLayerBase } from "../../components/JNComponent"; +import { app } from "../../App"; const { ccclass, property } = _decorator; @ccclass('LoadingView') diff --git a/JisolGameCocos/assets/script/ui/Novice/NoviceNamingView.ts b/JisolGameCocos/assets/script/ui/Novice/NoviceNamingView.ts index b7f3d578..806e46cd 100644 --- a/JisolGameCocos/assets/script/ui/Novice/NoviceNamingView.ts +++ b/JisolGameCocos/assets/script/ui/Novice/NoviceNamingView.ts @@ -1,7 +1,8 @@ import { _decorator, Component, Node } from 'cc'; -import { app, JNGLayerBase } from '../../App'; import { EditBox } from 'cc'; import { API } from '../../consts/API'; +import { JNGLayerBase } from '../../components/JNComponent'; +import { app } from '../../App'; const { ccclass, property } = _decorator; @ccclass('NoviceNamingView') diff --git a/JisolGameCocos/assets/script/ui/Novice/NoviceSelectPetView.ts b/JisolGameCocos/assets/script/ui/Novice/NoviceSelectPetView.ts index 793fffbe..0b744a89 100644 --- a/JisolGameCocos/assets/script/ui/Novice/NoviceSelectPetView.ts +++ b/JisolGameCocos/assets/script/ui/Novice/NoviceSelectPetView.ts @@ -1,13 +1,13 @@ -import { JNGLayerBase, TD, app } from '../../App'; import { TbGGlobalEnum } from '../../../resources/config/TbGGlobalEnum'; import { _decorator,Node } from 'cc'; import { sp } from 'cc'; import { UIPetAnim } from '../../consts/GData'; import { Sprite } from 'cc'; import { Color } from 'cc'; -import { API } from '../../consts/API'; import { GUI } from '../UIConfig'; import PlayerPetData from '../../data/PlayerPetData'; +import { JNGLayerBase } from '../../components/JNComponent'; +import { app, TD } from '../../App'; const { ccclass, property } = _decorator;