提交上阵

This commit is contained in:
PC-20230316NUNE\Administrator 2023-11-15 18:38:00 +08:00
parent d1783204ad
commit 391ce959cb
38 changed files with 3875 additions and 121 deletions

View File

@ -348,7 +348,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 720, "width": 720,
"height": 720 "height": 1280
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -4423,6 +4423,7 @@
}, },
"mask": false, "mask": false,
"maskOpcity": 80, "maskOpcity": 80,
"isClickMaskeClose": false,
"frameText": { "frameText": {
"__id__": 19 "__id__": 19
}, },

View File

@ -25,10 +25,13 @@
}, },
{ {
"__id__": 4 "__id__": 4
},
{
"__id__": 6
} }
], ],
"_prefab": { "_prefab": {
"__id__": 6 "__id__": 8
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -73,7 +76,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 335.53125, "width": 720,
"height": 50.4 "height": 50.4
}, },
"_anchorPoint": { "_anchorPoint": {
@ -110,13 +113,13 @@
"a": 255 "a": 255
}, },
"_string": "ScrollView content01", "_string": "ScrollView content01",
"_horizontalAlign": 0, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 36, "_actualFontSize": 36,
"_fontSize": 36, "_fontSize": 36,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 40, "_lineHeight": 40,
"_overflow": 0, "_overflow": 3,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
@ -132,6 +135,42 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "7ahEvd3z5N4ruHsPPLIdmV" "fileId": "7ahEvd3z5N4ruHsPPLIdmV"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"_alignFlags": 40,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 335.53125,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "61ikNaw6BJr7IaFbNvdfj8"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -141,6 +180,7 @@
"__id__": 0 "__id__": 0
}, },
"fileId": "b4aPDEneNHC4OYnY3k7ypP", "fileId": "b4aPDEneNHC4OYnY3k7ypP",
"instance": null,
"targetOverrides": null "targetOverrides": null
} }
] ]

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "35bdeb55-51fc-4cf0-8352-90aa9422da8d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "002acba0-daff-4ba2-a1cc-0bd6b522b819",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "9d7eeadb-58f6-4c42-aaed-bc402f272c84",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "阵法"
}
}

View File

@ -0,0 +1,593 @@
[
{
"__type__": "cc.Prefab",
"_name": "阵法节点",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "阵法节点",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 18
},
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
}
],
"_prefab": {
"__id__": 27
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -110,
"y": 110,
"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": "没有宠物",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_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.Node",
"_name": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
}
],
"_prefab": {
"__id__": 10
},
"_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__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64.3984375,
"height": 69
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "57tohbvq5DfqSeazSpahc7"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "+",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 100,
"_fontSize": 100,
"_fontFamily": "Arial",
"_lineHeight": 50,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b69Hawp/VJAJJTIr+OiBc7"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_width": 3,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d4gS8Lw1tFHa81PtPHRzaf"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "129GFUemtBFbVZkRJYzyID",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d4QFkSAFNDcI3m+mF1hDoB"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "89H2Y6T4BDHrwQMQSD6Rep",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "有宠物",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
}
],
"_prefab": {
"__id__": 17
},
"_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__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7f4JKo3WJKJa/8S/rSd4ph"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8dQqbrevlD0JCENds1sMve",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "64UUiPhsBGyYO5QK/i4llF"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"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": "23CcuxwSVD5rTkFLTkzmPx"
},
{
"__type__": "78c308a0dBCEJ/E9wZzZPJq",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "06AIrIH75LL7sccNjNaqQj"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 25
},
"clickEvents": [
{
"__id__": 26
}
],
"_interactable": true,
"_transition": 3,
"_normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"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": null,
"_hoverSprite": null,
"_pressedSprite": null,
"_disabledSprite": null,
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "efw+0GxCpOZ5ROxDkIQkn1"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "78c308a0dBCEJ/E9wZzZPJq",
"handler": "onClick",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f15AW5eMVEKKgrwPWb2eZo",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "11623136-ce7c-4aaf-9be6-c298c14d1e0d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "阵法节点"
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "e95d820d-01f5-40da-a6f0-a3eb7903c624",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,302 @@
[
{
"__type__": "cc.Prefab",
"_name": "IntoBattleView",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "IntoBattleView",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 8
},
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": {
"__id__": 14
},
"_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.Node",
"_name": "content",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_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__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 550,
"height": 800
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "68UQQu1bBAQrAtTHy1yB8t"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"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": "b3/zsRycZIh7r2rjWWtX8P"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8eQw+AA5xI/oCYsJa9dIvN",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 1280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "1dgJxmIH5HIpXD6y0/xMwI"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "582zBz6m5DKqmkTkiS/LE0"
},
{
"__type__": "00e5fiwk55OFq7ZIZmksXGJ",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"mask": true,
"maskOpcity": 80,
"isClickMaskeClose": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c64zkOp1tOEoCQ9P8CBNYJ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "08xLpDDa9NlK3pgR7XiOqb",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "eb53cac5-aaa5-4b5f-8a22-38bccee261dc",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "IntoBattleView"
}
}

View File

@ -4,6 +4,7 @@ import BaseData from "./data/BaseData";
import ChatData from "./data/ChatData"; import ChatData from "./data/ChatData";
import PlayerData from "./data/PlayerData"; import PlayerData from "./data/PlayerData";
import PlayerPetData from "./data/PlayerPetData"; import PlayerPetData from "./data/PlayerPetData";
import PlayerTacticalData from "./data/PlayerTacticalData";
//数据类 (用于初始化游戏信息) //数据类 (用于初始化游戏信息)
export class AppData extends SystemBase{ export class AppData extends SystemBase{
@ -14,6 +15,7 @@ export class AppData extends SystemBase{
PlayerData.getIns(), //玩家信息 PlayerData.getIns(), //玩家信息
PlayerPetData.getIns(), //玩家宠物信息 PlayerPetData.getIns(), //玩家宠物信息
ChatData.getIns(), //聊天 ChatData.getIns(), //聊天
PlayerTacticalData.getIns(), //阵法
]; ];
async onInit(): Promise<any> { async onInit(): Promise<any> {

View File

@ -6,6 +6,7 @@ import { Node } from "cc";
import { instantiate } from "cc"; import { instantiate } from "cc";
import { app } from "../App"; import { app } from "../App";
import { JNFrameInfo, JNSyncFrameEvent } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame"; import { JNFrameInfo, JNSyncFrameEvent } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
import { CCObject } from "cc";
export enum BattleMode{ export enum BattleMode{
//无尽模式 //无尽模式
@ -60,8 +61,6 @@ export default class GBattleModeManager extends Singleton {
//打开指定模式 //打开指定模式
async Open(mode:BattleMode,isAuto:boolean = false){ async Open(mode:BattleMode,isAuto:boolean = false){
await this.Close();
this.current = mode; this.current = mode;
this.setAuto(isAuto); this.setAuto(isAuto);
@ -75,7 +74,6 @@ export default class GBattleModeManager extends Singleton {
//主动调用场景销毁 //主动调用场景销毁
app.sync.onReset(); app.sync.onReset();
this.clear();
this.current = null; this.current = null;
} }
@ -94,6 +92,7 @@ export default class GBattleModeManager extends Singleton {
//创建当前模式 //创建当前模式
private create(){ private create(){
if(!this.isInit || this.current == null) return; if(!this.isInit || this.current == null) return;
let mode = instantiate(this.modes[this.current]); let mode = instantiate(this.modes[this.current]);
mode.getComponent(GBaseMode).camera = this.camera; mode.getComponent(GBaseMode).camera = this.camera;

View File

@ -34,9 +34,9 @@ export class GTactical{
//获取阵法 //获取阵法
static getTactical(isReversed:boolean = false): GTactical{ static getTactical(isReversed:boolean = false): GTactical{
let tactical = [ let tactical = [
[0,4,3], [7,4,1],
[6,0,1], [8,5,2],
[0,5,2], [9,6,3],
]; ];
if(isReversed){ if(isReversed){
tactical = this.getTacticalFlipX(tactical); tactical = this.getTacticalFlipX(tactical);

View File

@ -40,7 +40,7 @@ export interface GOnHookInfo{
} }
/** /**
* * ( 使)
*/ */
@ccclass('GOnHookMode') @ccclass('GOnHookMode')
export default class GOnHookMode extends GBaseMode<{}>{ export default class GOnHookMode extends GBaseMode<{}>{

View File

@ -13,20 +13,29 @@ const RData = (data:any,isTips:boolean = true) => {
} }
} }
/************** 请求类 *******************/
export interface NewsContext{ export interface NewsContext{
state:number, state:number,
msg:string, msg:string,
data:any, data:any,
} }
//玩家登录返回
export interface UserLoginVO{
token:string, //token
user:UserVO, //玩家信息
}
/************** 实体类 **************************/
//玩家信息
export interface UserVO{ export interface UserVO{
userId:number, //玩家Id userId:number, //玩家Id
userName:string, //玩家名称 userName:string, //玩家名称
userPass:string, //玩家密码 userPass:string, //玩家密码
} }
export interface UserLoginVO{ //游戏玩家信息
token:string, //token
user:UserVO, //玩家信息
}
export interface PlayerInfoOV{ export interface PlayerInfoOV{
playerId:number, //玩家Id playerId:number, //玩家Id
userId: number, //用户Id userId: number, //用户Id
@ -34,12 +43,18 @@ export interface PlayerInfoOV{
playerCreateTime:number, //玩家创建时间 playerCreateTime:number, //玩家创建时间
novice: false, //是否过引导 novice: false, //是否过引导
} }
//玩家宠物信息
export interface PlayerPetOV{ export interface PlayerPetOV{
petId:number, //宠物唯一Id petId:number, //宠物唯一Id
petPlayerId:number; //宠物的玩家Id petPlayerId:number; //宠物的玩家Id
petTbId:number; //宠物配置表Id petTbId:number; //宠物配置表Id
petGrade:number; //宠物等级 petGrade:number; //宠物等级
} }
//玩家阵法信息
export interface PlayerTacticalOV{
playerId:number, //玩家Id
tacticalData:string, //阵法数据
}
export const API = { export const API = {
@ -54,5 +69,9 @@ export const API = {
/********** 宠物接口 ******************/ /********** 宠物接口 ******************/
GetPlayerPets: async () => RData(await app.api.get(`/game/pet/list`),false) as PlayerPetOV[], //获取玩家全部宠物 GetPlayerPets: async () => RData(await app.api.get(`/game/pet/list`),false) as PlayerPetOV[], //获取玩家全部宠物
/********** 阵法接口 ******************/
GetPlayerTactical: async () => RData(await app.api.get(`/game/tactical/get`),false) as PlayerTacticalOV, //获取玩家阵法
SetPlayerTactical: async (data:PlayerTacticalOV) => RData(await app.api.post(`/game/tactical/set`,data),false) as PlayerTacticalOV, //更新玩家阵法
} }

View File

@ -7,12 +7,11 @@ import BaseData from "./BaseData";
//聊天数据 //聊天数据
export default class ChatData extends BaseData{ export default class ChatData extends BaseData{
static Event = "ChatData_Event_Message";
//世界消息列表 //世界消息列表
datas:string[] = []; datas:string[] = [];
//接受消息事件
receives:Function[] = [];
onInit() { onInit() {
//监听聊天消息 //监听聊天消息
app.socket.on(GAction.CHAT_RECEIVE_MESSAGE,this.onChatReceiveMessage,this,GActionType.GUIChatMessage); app.socket.on(GAction.CHAT_RECEIVE_MESSAGE,this.onChatReceiveMessage,this,GActionType.GUIChatMessage);
@ -23,7 +22,7 @@ export default class ChatData extends BaseData{
onChatReceiveMessage(info:GUIChatMessage){ onChatReceiveMessage(info:GUIChatMessage){
console.log(`ChatData - onChatReceiveMessage`,info.message); console.log(`ChatData - onChatReceiveMessage`,info.message);
this.datas.push(info.message); this.datas.push(info.message);
this.receives.forEach(fun => fun(info)) app.event.emit(ChatData.Event,info);
} }
//发送消息 //发送消息
@ -32,14 +31,12 @@ export default class ChatData extends BaseData{
} }
//监听接受消息 //监听接受消息
on(receive:Function){ on(receive:Function,target?: any){
this.receives.push(receive); app.event.on(ChatData.Event,receive,target)
} }
//取消 //取消
off(receive:Function){ off(receive:Function,target?: any){
let index = this.receives.indexOf(receive); app.event.off(ChatData.Event,receive,target)
if(index != -1)
this.receives.splice(index,1);
} }
} }

View File

@ -0,0 +1,50 @@
import { API, PlayerTacticalOV } from "../consts/API";
import BaseData from "./BaseData";
interface PlayerTacticalInfo extends PlayerTacticalOV{
roles:number[], //上阵的宠物顺序
}
//玩家阵法数据 (玩家最多上阵 9 个宠物)
export default class PlayerTacticalData extends BaseData{
//阵法信息
info:PlayerTacticalInfo;
async onInit() {
await this.onUpdateInfo();
}
//更新阵法信息
async onUpdateInfo(){
let ov = await API.GetPlayerTactical();
if(!ov.tacticalData){
ov.tacticalData = JSON.stringify(this.getTacticalInfo());
}
this.info = {
...ov,
roles: JSON.parse(ov.tacticalData),
}
}
//更新上阵
async UpdateTactical(roles:number[]){
this.info.roles = roles;
this.info.tacticalData = JSON.stringify(this.info.roles);
//上传到服务器
await API.SetPlayerTactical(this.info);
}
//获取指定位置
getItem(index:number){
return this.info.roles[index];
}
//获取初始化上阵信息
getTacticalInfo():number[]{
return [0,0,0,0,0,0,0,0,0]
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "d2425352-add6-461a-ab20-32515cf9eb1e",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "0c3951ab-4554-4998-ad31-2acc45233dbd",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "231e3614-8fc2-4590-bc9f-57ff63343f85",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,30 @@
import { _decorator, Component, Node } from 'cc';
import PlayerTacticalData from '../../../data/PlayerTacticalData';
import { app } from '../../../App';
import { GUI } from '../../UIConfig';
const { ccclass, property } = _decorator;
@ccclass('PlayerTacticalItem')
export class PlayerTacticalItem extends Component {
//阵法的Index;
index:number;
//初始化阵法
onInit(index:number){
this.index = index;
}
//更新信息
onUpdateView(){
PlayerTacticalData.getIns().getItem(this.index);
}
//点击
onClick(){
app.layer.Open(GUI.IntoBattleView);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "78c30f1a-d1d0-4210-9fc4-f7067364f26a",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,35 @@
import { _decorator, Component, Node } from 'cc';
import { PlayerTacticalItem } from './PlayerTacticalItem';
const { ccclass, property } = _decorator;
/**
*
*/
@ccclass('PlayerTacticalView')
export class PlayerTacticalView extends Component {
//阵法子节点列表
items:PlayerTacticalItem[] = [];
// onLoad(){
// //阵法
// this.items = this.node.getComponentsInChildren(PlayerTacticalItem);
// this.items.forEach((item,index) => item.onInit(index));
// this.onUpdateView();
// }
// //更新阵法显示
// onUpdateView(){
// this.items.forEach(item => {
// item.onUpdateView();
// })
// }
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "a9372de8-9c71-492e-af72-cee66fd5e045",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -30,13 +30,13 @@ export class MainChatView extends JNGLayerBase {
this.onInitUpdate(); this.onInitUpdate();
//监听消息 //监听消息
ChatData.getIns().on(this.onMessage.bind(this)); ChatData.getIns().on(this.onMessage.bind(this),this);
} }
onJNClose(): void { onJNClose(): void {
super.onJNClose(); super.onJNClose();
ChatData.getIns().off(this.onMessage.bind(this)); ChatData.getIns().off(this.onMessage.bind(this),this);
} }
//初始化聊天显示 //初始化聊天显示

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "01b33bd2-2568-49ba-a042-ba4178c96227",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,14 @@
import { _decorator, Component, Node } from 'cc';
import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
const { ccclass, property } = _decorator;
//上阵页面
@ccclass('IntoBattleView')
export class IntoBattleView extends JNLayerBase {
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "00e5f8b0-939e-4e16-aed9-2199a4b17189",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -13,13 +13,15 @@ export enum GUI{
Loading = "Loading", //加载页面 Loading = "Loading", //加载页面
Tips = "Tips", //提示 Tips = "Tips", //提示
/** 主页页面 */
MainChat = "MainChat", //主页聊天页面
/** 新手引导 */ /** 新手引导 */
NoviceNamingView = "NoviceNamingView", //新手引导页面 - 取名 NoviceNamingView = "NoviceNamingView", //新手引导页面 - 取名
NoviceSelectPetView = "NoviceSelectPetView", //新手引导页面 - 选择宠物 NoviceSelectPetView = "NoviceSelectPetView", //新手引导页面 - 选择宠物
/** 主页页面 */
MainChat = "MainChat", //主页聊天页面
IntoBattleView = "IntoBattleView", //上阵页面
Home = "Home", //主页面 Home = "Home", //主页面
Main = "Main", //主页面2 Main = "Main", //主页面2
} }
@ -110,6 +112,14 @@ export const UIConfig:{ [key: string]: JNLayerInfo; } = {
backInfo:{key:"position",start:v3(0,0,0),end:v3(-720,0,0)} backInfo:{key:"position",start:v3(0,0,0),end:v3(-720,0,0)}
}, },
}, },
[GUI.IntoBattleView]:{
layer:GLayer.View,
uri: "prefab/ui/阵法/IntoBattleView",
anims:{
front:JNLayerAnim.BackOutOpen,
back:JNLayerAnim.BackInClose
},
},
...UISystemConfig, //系统页面 ...UISystemConfig, //系统页面
...UINoviceConfig, //新手引导页面 ...UINoviceConfig, //新手引导页面
...UIMainConfig, //主页面 ...UIMainConfig, //主页面

@ -1 +1 @@
Subproject commit c5432ebb220d354a6790fa96348c70620cb16dcc Subproject commit ccb2f088bd74f0d011f38bcc21f6faf80e4ded4d

View File

@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
/** /**
* 玩家 * 玩家宠物
*/ */
@Api(value = "JNGameDemo - API", tags = {"PET - API"}) @Api(value = "JNGameDemo - API", tags = {"PET - API"})
@RestController @RestController

View File

@ -0,0 +1,68 @@
package cn.jisol.game.controller.game;
import cn.jisol.game.controller.argsresolver.CurrentPlayer;
import cn.jisol.game.entity.game.Player;
import cn.jisol.game.entity.game.PlayerPet;
import cn.jisol.game.entity.game.PlayerTactical;
import cn.jisol.game.service.PlayerPetService;
import cn.jisol.game.service.PlayerTacticalService;
import cn.jisol.ngame.util.NewsContext;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
* 玩家阵法
*/
@Api(value = "JNGameDemo - API", tags = {"PET - API"})
@RestController
@RequestMapping("/game/tactical")
@ResponseBody
public class GPlayerTacticalController {
@Autowired
PlayerTacticalService playerTacticalService;
//获取玩家阵法
@ApiImplicitParams({})
@ApiOperation(value = "获取玩家阵法")
@GetMapping("/get")
public NewsContext<PlayerTactical> getInfo(@CurrentPlayer Player player){
PlayerTactical info = playerTacticalService.getById(player.getPlayerId());
//如果没有阵法则创建一个
if(Objects.isNull(info)){
try{
info = PlayerTactical.builder().playerId(player.getPlayerId()).build();
playerTacticalService.saveOrUpdate(info);
}catch (Exception ignored){}
assert playerTacticalService != null;
info = playerTacticalService.getById(player.getPlayerId());
}
return NewsContext.onSuccess("获取成功",info);
}
//设置玩家上阵
@ApiImplicitParams({})
@ApiOperation(value = "设置玩家上阵")
@GetMapping("/set")
public NewsContext<PlayerTactical> setInfo(@CurrentPlayer Player player, @RequestBody PlayerTactical tactical){
tactical.setPlayerId(player.getPlayerId());
if(Objects.isNull(tactical.getTacticalData())) return NewsContext.onFail("上阵失败 没有上阵信息");
playerTacticalService.saveOrUpdate(tactical);
return NewsContext.onSuccess("上阵成功",tactical);
}
}

View File

@ -0,0 +1,21 @@
package cn.jisol.game.entity.game;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Builder;
import lombok.Data;
/**
* 玩家阵法
*/
@Builder
@Data
@TableName("`player_tactical`")
public class PlayerTactical {
@TableId(type = IdType.INPUT)
private Long playerId; //玩家Id
private String tacticalData; //阵法数据
}

View File

@ -0,0 +1,11 @@
package cn.jisol.game.mapper;
import cn.jisol.game.entity.game.PlayerPet;
import cn.jisol.game.entity.game.PlayerTactical;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Component;
@Component
public interface PlayerTacticalMapper extends BaseMapper<PlayerTactical> {
}

View File

@ -0,0 +1,9 @@
package cn.jisol.game.service;
import cn.jisol.game.entity.game.PlayerPet;
import cn.jisol.game.entity.game.PlayerTactical;
import com.baomidou.mybatisplus.extension.service.IService;
public interface PlayerTacticalService extends IService<PlayerTactical> {
}

View File

@ -0,0 +1,15 @@
package cn.jisol.game.service.impl;
import cn.jisol.game.entity.game.PlayerPet;
import cn.jisol.game.entity.game.PlayerTactical;
import cn.jisol.game.mapper.PlayerPetMapper;
import cn.jisol.game.mapper.PlayerTacticalMapper;
import cn.jisol.game.service.PlayerPetService;
import cn.jisol.game.service.PlayerTacticalService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class PlayerTacticalServiceImpl extends ServiceImpl<PlayerTacticalMapper, PlayerTactical> implements PlayerTacticalService {
}