奖励已经双倍奖励
This commit is contained in:
@@ -5430,7 +5430,7 @@
|
||||
"__id__": 252
|
||||
}
|
||||
],
|
||||
"_active": false,
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 258
|
||||
@@ -5473,7 +5473,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Alert_Diamond_Single_Green",
|
||||
"_name": "ItemFrame_Square_02_White_Glow",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
@@ -5495,7 +5495,7 @@
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"y": 2.822,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -5507,8 +5507,8 @@
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1.8,
|
||||
"y": 0.8,
|
||||
"x": 0.5,
|
||||
"y": 0.5,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
@@ -5533,142 +5533,6 @@
|
||||
"__prefab": {
|
||||
"__id__": 242
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 64,
|
||||
"height": 66
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "a4si6JJpxNHK/dfxkE6T1k"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 240
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 244
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@b9538",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 1,
|
||||
"_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": "1dFcfcZK1LerclklSRngjk"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "2ffpjuydBPYIjqrBZMfVl3",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "ItemFrame_Square_02_White_Glow",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 239
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 247
|
||||
},
|
||||
{
|
||||
"__id__": 249
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 251
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0.4,
|
||||
"y": 0.4,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 246
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 248
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 169,
|
||||
@@ -5691,11 +5555,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 246
|
||||
"__id__": 240
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 250
|
||||
"__id__": 244
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -5703,7 +5567,7 @@
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 235,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
@@ -5745,7 +5609,143 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Label",
|
||||
"_name": "A2",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 239
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 247
|
||||
},
|
||||
{
|
||||
"__id__": 249
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 251
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -19.778,
|
||||
"y": -13.516,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0.4,
|
||||
"y": 0.4,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 246
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 248
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 128,
|
||||
"height": 128
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.2,
|
||||
"y": 0.2
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "49ruiJnPBLjbOvLAEw1Mjr"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 246
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 250
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@dd43c",
|
||||
"__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": "bbAGM4/4tCOaqRwqDqyCQx"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "c7vY5rRzhNw6+56rw4IWgo",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "A1",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
@@ -5766,8 +5766,8 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 2.609,
|
||||
"x": 15.226,
|
||||
"y": -13.516,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -5779,8 +5779,8 @@
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"x": -0.4,
|
||||
"y": 0.4,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
@@ -5807,22 +5807,22 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 64,
|
||||
"height": 54.4
|
||||
"width": 128,
|
||||
"height": 128
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
"x": 0.2,
|
||||
"y": 0.2
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "98dRJG/51GGIQxCRNQs2DQ"
|
||||
"fileId": "54FVKG0DdHYrA/UoPBdQhi"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
@@ -5843,51 +5843,28 @@
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_string": "出战中",
|
||||
"_horizontalAlign": 1,
|
||||
"_verticalAlign": 1,
|
||||
"_actualFontSize": 20,
|
||||
"_fontSize": 20,
|
||||
"_fontFamily": "Arial",
|
||||
"_lineHeight": 40,
|
||||
"_overflow": 0,
|
||||
"_enableWrapText": true,
|
||||
"_font": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_isItalic": false,
|
||||
"_isBold": true,
|
||||
"_isUnderline": false,
|
||||
"_underlineHeight": 2,
|
||||
"_cacheMode": 0,
|
||||
"_enableOutline": true,
|
||||
"_outlineColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 201
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@dd43c",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_outlineWidth": 2,
|
||||
"_enableShadow": false,
|
||||
"_shadowColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_shadowOffset": {
|
||||
"_type": 0,
|
||||
"_fillType": 0,
|
||||
"_sizeMode": 1,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 2,
|
||||
"y": 2
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_shadowBlur": 2,
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "cfWQzB1D5AioDPq4m9YNSt"
|
||||
"fileId": "a6L6kizgdJwKFIV9n530Mh"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -5897,7 +5874,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "357wISCC5GiYtsOXFHcebY",
|
||||
"fileId": "e7GtArvl1Pjo2JGWwgaw4k",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -5988,7 +5965,7 @@
|
||||
"__id__": 272
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 278
|
||||
|
||||
1952
assets/resources/game/gui/item.prefab
Normal file
1952
assets/resources/game/gui/item.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,12 @@
|
||||
"ver": "1.1.50",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "1e5c8a8d-fce5-4c4b-b62b-b0f538c7e98c",
|
||||
"uuid": "c2e2497a-9ce4-4580-9f16-caef7cdaff65",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "heros"
|
||||
"syncNodeName": "item"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
"speed": 1,
|
||||
"wrapMode": 2,
|
||||
"enableTrsBlending": false,
|
||||
"_duration": 1,
|
||||
"_duration": 0.6666666666666666,
|
||||
"_hash": 500763545,
|
||||
"_tracks": [
|
||||
{
|
||||
@@ -19,13 +19,16 @@
|
||||
},
|
||||
{
|
||||
"__id__": 12
|
||||
},
|
||||
{
|
||||
"__id__": 23
|
||||
}
|
||||
],
|
||||
"_exoticAnimation": null,
|
||||
"_events": [],
|
||||
"_embeddedPlayers": [],
|
||||
"_additiveSettings": {
|
||||
"__id__": 22
|
||||
"__id__": 34
|
||||
},
|
||||
"_auxiliaryCurveEntries": []
|
||||
},
|
||||
@@ -77,22 +80,22 @@
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.5,
|
||||
1
|
||||
0.3333333333333333,
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0.4,
|
||||
"value": 0.4000000059604645,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -105,23 +108,19 @@
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
"__editorExtras__": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0.4,
|
||||
"value": 0.4000000059604645,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
"__editorExtras__": null
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
@@ -137,22 +136,22 @@
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.5,
|
||||
1
|
||||
0.3333333333333333,
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0.4,
|
||||
"value": 0.4000000059604645,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -165,23 +164,19 @@
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
"__editorExtras__": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0.4,
|
||||
"value": 0.4000000059604645,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
"__editorExtras__": null
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
@@ -197,8 +192,8 @@
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.5,
|
||||
1
|
||||
0.3333333333333333,
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
@@ -212,7 +207,7 @@
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -225,9 +220,7 @@
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
"__editorExtras__": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
@@ -239,9 +232,7 @@
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
"__editorExtras__": null
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
@@ -271,16 +262,16 @@
|
||||
},
|
||||
"_channels": [
|
||||
{
|
||||
"__id__": 14
|
||||
"__id__": 15
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
"__id__": 17
|
||||
},
|
||||
{
|
||||
"__id__": 18
|
||||
"__id__": 19
|
||||
},
|
||||
{
|
||||
"__id__": 20
|
||||
"__id__": 21
|
||||
}
|
||||
],
|
||||
"_nComponents": 3
|
||||
@@ -288,63 +279,100 @@
|
||||
{
|
||||
"__type__": "cc.animation.TrackPath",
|
||||
"_paths": [
|
||||
"scale"
|
||||
{
|
||||
"__id__": 14
|
||||
},
|
||||
"eulerAngles"
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.HierarchyPath",
|
||||
"path": "A2"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 15
|
||||
"__id__": 16
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.16666666666666666,
|
||||
0.3333333333333333,
|
||||
0.5,
|
||||
1
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1.1,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -354,57 +382,87 @@
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 17
|
||||
"__id__": 18
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.16666666666666666,
|
||||
0.3333333333333333,
|
||||
0.5,
|
||||
1
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1.1,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -414,57 +472,87 @@
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 19
|
||||
"__id__": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.16666666666666666,
|
||||
0.3333333333333333,
|
||||
0.5,
|
||||
1
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1,
|
||||
"value": 20,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 1,
|
||||
"value": 60,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 20,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -474,7 +562,268 @@
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 21
|
||||
"__id__": 22
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [],
|
||||
"_values": [],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.VectorTrack",
|
||||
"_binding": {
|
||||
"__type__": "cc.animation.TrackBinding",
|
||||
"path": {
|
||||
"__id__": 24
|
||||
},
|
||||
"proxy": null
|
||||
},
|
||||
"_channels": [
|
||||
{
|
||||
"__id__": 26
|
||||
},
|
||||
{
|
||||
"__id__": 28
|
||||
},
|
||||
{
|
||||
"__id__": 30
|
||||
},
|
||||
{
|
||||
"__id__": 32
|
||||
}
|
||||
],
|
||||
"_nComponents": 3
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.TrackPath",
|
||||
"_paths": [
|
||||
{
|
||||
"__id__": 25
|
||||
},
|
||||
"eulerAngles"
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.HierarchyPath",
|
||||
"path": "A1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 27
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0.16666666666666666,
|
||||
0.3333333333333333,
|
||||
0.5
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 29
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0.16666666666666666,
|
||||
0.3333333333333333,
|
||||
0.5
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.16666666666666666,
|
||||
0.3333333333333333,
|
||||
0.5,
|
||||
0.6666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": -20,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": -60,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": -20,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"broken": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 33
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
3950
assets/resources/gui/element/item_info.prefab
Normal file
3950
assets/resources/gui/element/item_info.prefab
Normal file
File diff suppressed because it is too large
Load Diff
13
assets/resources/gui/element/item_info.prefab.meta
Normal file
13
assets/resources/gui/element/item_info.prefab.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "be42c863-cdad-41da-9fc9-c97b60d2d424",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "item_info"
|
||||
}
|
||||
}
|
||||
@@ -37,23 +37,23 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 191
|
||||
"__id__": 212
|
||||
},
|
||||
{
|
||||
"__id__": 193
|
||||
"__id__": 214
|
||||
},
|
||||
{
|
||||
"__id__": 195
|
||||
"__id__": 216
|
||||
},
|
||||
{
|
||||
"__id__": 197
|
||||
"__id__": 218
|
||||
},
|
||||
{
|
||||
"__id__": 199
|
||||
"__id__": 220
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 201
|
||||
"__id__": 222
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -1131,7 +1131,7 @@
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 6.674,
|
||||
"y": 13.527,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -1172,7 +1172,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 600,
|
||||
"height": 350
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -1197,7 +1197,7 @@
|
||||
"__prefab": {
|
||||
"__id__": 60
|
||||
},
|
||||
"_resizeMode": 2,
|
||||
"_resizeMode": 1,
|
||||
"_layoutType": 3,
|
||||
"_cellSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -1242,7 +1242,7 @@
|
||||
"_top": 285.44900000000007,
|
||||
"_bottom": 874.5509999999999,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 6.674,
|
||||
"_verticalCenter": 13.527,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
@@ -3198,22 +3198,25 @@
|
||||
},
|
||||
{
|
||||
"__id__": 169
|
||||
},
|
||||
{
|
||||
"__id__": 190
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 184
|
||||
"__id__": 205
|
||||
},
|
||||
{
|
||||
"__id__": 186
|
||||
"__id__": 207
|
||||
},
|
||||
{
|
||||
"__id__": 188
|
||||
"__id__": 209
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 190
|
||||
"__id__": 211
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -3274,7 +3277,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -115,
|
||||
"x": -250,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@@ -3618,7 +3621,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "next",
|
||||
"_name": "double",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
@@ -3627,26 +3630,540 @@
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 170
|
||||
},
|
||||
{
|
||||
"__id__": 176
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 176
|
||||
"__id__": 182
|
||||
},
|
||||
{
|
||||
"__id__": 178
|
||||
"__id__": 184
|
||||
},
|
||||
{
|
||||
"__id__": 180
|
||||
"__id__": 186
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 183
|
||||
"__id__": 189
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 115,
|
||||
"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": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "ItemIcon_Ad",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 169
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 171
|
||||
},
|
||||
{
|
||||
"__id__": 173
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 175
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -49.451,
|
||||
"y": 10.279,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0.5,
|
||||
"y": 0.5,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 170
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 172
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 128,
|
||||
"height": 128
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "85j44YyhNHdYUwB2+DJteI"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 170
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 174
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@ac64d",
|
||||
"__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": "cam62k2lRCkpudpp10d65R"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "acedjmLHRBFbV+Amw1HgJO",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Label",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 169
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 177
|
||||
},
|
||||
{
|
||||
"__id__": 179
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 181
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 29.471,
|
||||
"y": 5,
|
||||
"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": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 176
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 178
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 84,
|
||||
"height": 54.4
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "67QLzad1FCiJ/AdIhSMuR2"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 176
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 180
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_string": "双倍",
|
||||
"_horizontalAlign": 1,
|
||||
"_verticalAlign": 1,
|
||||
"_actualFontSize": 40,
|
||||
"_fontSize": 40,
|
||||
"_fontFamily": "Arial",
|
||||
"_lineHeight": 40,
|
||||
"_overflow": 0,
|
||||
"_enableWrapText": true,
|
||||
"_font": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_isItalic": false,
|
||||
"_isBold": true,
|
||||
"_isUnderline": false,
|
||||
"_underlineHeight": 2,
|
||||
"_cacheMode": 0,
|
||||
"_enableOutline": true,
|
||||
"_outlineColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_outlineWidth": 2,
|
||||
"_enableShadow": true,
|
||||
"_shadowColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_shadowOffset": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 2,
|
||||
"y": -2
|
||||
},
|
||||
"_shadowBlur": 2,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "bd1H6njltNOKbbnfVCXC2b"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "56tqbYiZhPVIRNwWd066ey",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 169
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 183
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 240,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "3dIKTiZhBJ2aCD+iv/GDpy"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 169
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 185
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@35da0",
|
||||
"__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": {
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717",
|
||||
"__expectedType__": "cc.SpriteAtlas"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "32L37hnJpKQ5dzlw9gtGRv"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Button",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 169
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 187
|
||||
},
|
||||
"clickEvents": [
|
||||
{
|
||||
"__id__": 188
|
||||
}
|
||||
],
|
||||
"_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": "45RMvIGX1FPa6BAc6rh7Bz"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ClickEvent",
|
||||
"target": {
|
||||
"__id__": 1
|
||||
},
|
||||
"component": "",
|
||||
"_componentId": "463c7iN7clDbLBuuJ6fqWQv",
|
||||
"handler": "double_reward",
|
||||
"customEventData": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "d61Jh2nXVAJI/rfsCngv3Y",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "next",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 153
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 191
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 197
|
||||
},
|
||||
{
|
||||
"__id__": 199
|
||||
},
|
||||
{
|
||||
"__id__": 201
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 204
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 250,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@@ -3679,20 +4196,20 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 169
|
||||
"__id__": 190
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 171
|
||||
"__id__": 192
|
||||
},
|
||||
{
|
||||
"__id__": 173
|
||||
"__id__": 194
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 175
|
||||
"__id__": 196
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -3729,11 +4246,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 170
|
||||
"__id__": 191
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 172
|
||||
"__id__": 193
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -3757,11 +4274,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 170
|
||||
"__id__": 191
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 174
|
||||
"__id__": 195
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -3838,11 +4355,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 169
|
||||
"__id__": 190
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 177
|
||||
"__id__": 198
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -3866,11 +4383,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 169
|
||||
"__id__": 190
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 179
|
||||
"__id__": 200
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -3911,15 +4428,15 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 169
|
||||
"__id__": 190
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 181
|
||||
"__id__": 202
|
||||
},
|
||||
"clickEvents": [
|
||||
{
|
||||
"__id__": 182
|
||||
"__id__": 203
|
||||
}
|
||||
],
|
||||
"_interactable": true,
|
||||
@@ -3998,11 +4515,11 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 185
|
||||
"__id__": 206
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 490,
|
||||
"width": 760,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
@@ -4026,7 +4543,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 187
|
||||
"__id__": 208
|
||||
},
|
||||
"_resizeMode": 1,
|
||||
"_layoutType": 1,
|
||||
@@ -4064,7 +4581,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 189
|
||||
"__id__": 210
|
||||
},
|
||||
"_alignFlags": 4,
|
||||
"_target": null,
|
||||
@@ -4113,7 +4630,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 192
|
||||
"__id__": 213
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -4141,7 +4658,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 194
|
||||
"__id__": 215
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
@@ -4159,7 +4676,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 196
|
||||
"__id__": 217
|
||||
},
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
@@ -4195,7 +4712,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 198
|
||||
"__id__": 219
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -4237,7 +4754,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 200
|
||||
"__id__": 221
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<string>{0,-1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{71,65}</string>
|
||||
<string>{44,52}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{64,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{153,144},{71,65}}</string>
|
||||
<string>{{93,1},{44,52}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1002.png</key>
|
||||
<dict>
|
||||
@@ -28,13 +28,13 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<string>{0,-1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{73,61}</string>
|
||||
<string>{44,52}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{64,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{202,81},{73,61}}</string>
|
||||
<string>{{139,1},{44,52}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
@@ -45,13 +45,13 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<string>{0,-1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,61}</string>
|
||||
<string>{44,52}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{64,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{123,81},{77,61}}</string>
|
||||
<string>{{185,1},{44,52}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
@@ -62,13 +62,13 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<string>{0,-1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,65}</string>
|
||||
<string>{44,52}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{64,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,206},{77,65}}</string>
|
||||
<string>{{231,1},{44,52}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
@@ -81,13 +81,13 @@
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,61}</string>
|
||||
<string>{45,49}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{289,218},{77,61}}</string>
|
||||
<string>{{771,1},{45,49}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1006.png</key>
|
||||
<dict>
|
||||
@@ -98,15 +98,15 @@
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,63}</string>
|
||||
<string>{51,47}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{277,74},{77,63}}</string>
|
||||
<string>{{432,1},{51,47}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1007.Png</key>
|
||||
<key>1007.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
@@ -115,15 +115,15 @@
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,71}</string>
|
||||
<string>{51,47}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,133},{77,71}}</string>
|
||||
<string>{{481,1},{51,47}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1008.Png</key>
|
||||
<key>1008.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
@@ -132,13 +132,13 @@
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{71,71}</string>
|
||||
<string>{51,47}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{286,1},{71,71}}</string>
|
||||
<string>{{530,1},{51,47}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1009.png</key>
|
||||
<dict>
|
||||
@@ -147,13 +147,13 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{54,60}</string>
|
||||
<string>{51,43}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{208,217},{54,60}}</string>
|
||||
<string>{{726,1},{51,43}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
</dict>
|
||||
@@ -164,15 +164,32 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,-2}</string>
|
||||
<string>{0,-1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{62,54}</string>
|
||||
<string>{42,56}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{64,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{438,1},{62,54}}</string>
|
||||
<string>{{1,1},{42,56}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1011.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,-1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{46,54}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{64,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{45,1},{46,54}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1012.png</key>
|
||||
<dict>
|
||||
@@ -181,15 +198,15 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,-1}</string>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{54,60}</string>
|
||||
<string>{51,47}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{233,273},{54,60}}</string>
|
||||
<string>{{579,1},{51,47}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1013.png</key>
|
||||
<dict>
|
||||
@@ -198,15 +215,15 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{56,60}</string>
|
||||
<string>{51,47}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,273},{56,60}}</string>
|
||||
<string>{{628,1},{51,47}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1014.png</key>
|
||||
<dict>
|
||||
@@ -215,15 +232,15 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{54,60}</string>
|
||||
<string>{51,49}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{438,65},{54,60}}</string>
|
||||
<string>{{381,1},{51,49}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1015.png</key>
|
||||
<dict>
|
||||
@@ -232,15 +249,15 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,-2}</string>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{62,54}</string>
|
||||
<string>{51,47}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{80,217},{62,54}}</string>
|
||||
<string>{{677,1},{51,47}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>1016.png</key>
|
||||
<dict>
|
||||
@@ -249,68 +266,17 @@
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,-1}</string>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{54,60}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{425,131},{54,60}}</string>
|
||||
<string>{{277,1},{51,51}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1017.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{56,60}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{59,273},{56,60}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1018.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{56,60}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{117,273},{56,60}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1019.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{56,60}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{175,273},{56,60}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1020.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
@@ -319,249 +285,11 @@
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{54,60}</string>
|
||||
<string>{49,51}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<string>{51,51}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{419,269},{54,60}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1021.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,-2}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{62,54}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{144,217},{62,54}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>1022.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,-1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{54,60}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{70,70}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{423,200},{54,60}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>2007.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{120,64}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{120,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,1},{120,64}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>2008.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{120,64}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{120,64}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{1,67},{120,64}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>3002.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,71}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{207,1},{77,71}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>3003.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,63}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{289,139},{77,63}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>3004.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,65}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{359,1},{77,65}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>3005.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{77,61}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{359,68},{77,61}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>9001.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{61,65}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{352,269},{61,65}}</string>
|
||||
<key>textureRotated</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>9002.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{71,71}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{80,144},{71,71}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>9003.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{82,78}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{90,90}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{123,1},{82,78}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>9005.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{67,67}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{220,144},{67,67}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>9006.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{67,67}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{356,131},{67,67}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>9007.Png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>anchor</key>
|
||||
<string>{0.5,0.5}</string>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,1}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{67,67}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{77,77}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{354,200},{67,67}}</string>
|
||||
<string>{{330,1},{49,51}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
@@ -577,9 +305,9 @@
|
||||
<key>realTextureFileName</key>
|
||||
<string>items.png</string>
|
||||
<key>size</key>
|
||||
<string>{493,334}</string>
|
||||
<string>{817,58}</string>
|
||||
<key>smartupdate</key>
|
||||
<string>$TexturePacker:SmartUpdate:1bc512f8dc1baac0d03997c773bef4ca:0631a07c70b9bd4ccdd225f169eb27c3:9b2c40378ce3448cae3ca053079d3001$</string>
|
||||
<string>$TexturePacker:SmartUpdate:3027c7eafa8a769d8f7cb790c1044b73:135ef51b06d7bd52de8f1dd81c40859e:9b2c40378ce3448cae3ca053079d3001$</string>
|
||||
<key>textureFileName</key>
|
||||
<string>items.png</string>
|
||||
</dict>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 62 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 586 KiB After Width: | Height: | Size: 574 KiB |
@@ -1,3 +1,4 @@
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { WxCloudApi ,UserGameData} from "../wx_clound_client_api/WxCloudApi";
|
||||
import { smc } from "./SingletonModuleComp";
|
||||
|
||||
@@ -47,7 +48,7 @@ export class GameDataSyncManager {
|
||||
|
||||
// 直接覆盖道具数据
|
||||
if (remoteData.items) {
|
||||
Object.assign(smc.itmes, remoteData.items);
|
||||
Object.assign(smc.items, remoteData.items);
|
||||
console.log(`[Initialize]: 道具数据已从${dataSource}覆盖`);
|
||||
}
|
||||
|
||||
@@ -238,183 +239,6 @@ export class GameDataSyncManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定英雄
|
||||
* @param heroId 英雄ID
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async deleteHero(heroId: number): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 删除英雄 ID:${heroId}`);
|
||||
|
||||
const result = await WxCloudApi.deleteHero(heroId);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
delete smc.heros[heroId];
|
||||
console.log(`[GameDataSyncManager]: 英雄删除成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 英雄删除失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 删除英雄异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 库存管理 (items, tals, equips) ====================
|
||||
|
||||
/**
|
||||
* 增加指定物品的数量
|
||||
* @param type 库存类型 ('items', 'tals', 'equips')
|
||||
* @param itemId 物品ID
|
||||
* @param count 添加数量
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async addInventoryItem(type: 'items' | 'tals' | 'equips', itemId: number, count: number): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 增加库存物品 类型:${type}, ID:${itemId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.addInventoryItem(type, itemId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
const targetData = this.getTargetData(type);
|
||||
targetData[itemId] = (targetData[itemId] || 0) + count;
|
||||
console.log(`[GameDataSyncManager]: 库存物品增加成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 库存物品增加失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 增加库存物品异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗指定数量的物品
|
||||
* @param type 库存类型 ('items', 'tals', 'equips')
|
||||
* @param itemId 物品ID
|
||||
* @param count 消耗数量
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async consumeInventoryItem(type: 'items' | 'tals' | 'equips', itemId: number, count: number): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 消耗库存物品 类型:${type}, ID:${itemId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.consumeInventoryItem(type, itemId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
const targetData = this.getTargetData(type);
|
||||
targetData[itemId] = Math.max(0, (targetData[itemId] || 0) - count);
|
||||
console.log(`[GameDataSyncManager]: 库存物品消耗成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 库存物品消耗失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 消耗库存物品异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接设置物品的数量
|
||||
* @param type 库存类型 ('items', 'tals', 'equips')
|
||||
* @param itemId 物品ID
|
||||
* @param count 新的数量
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async setInventoryItem(type: 'items' | 'tals' | 'equips', itemId: number, count: number): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 设置库存物品 类型:${type}, ID:${itemId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.setInventoryItem(type, itemId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
const targetData = this.getTargetData(type);
|
||||
targetData[itemId] = count;
|
||||
console.log(`[GameDataSyncManager]: 库存物品设置成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 库存物品设置失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 设置库存物品异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新多个物品的数量
|
||||
* @param type 库存类型 ('items', 'tals', 'equips')
|
||||
* @param data 更新数据对象
|
||||
* @param merge 是否合并更新(默认true)
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async updateInventory(type: 'items' | 'tals' | 'equips', data: any, merge: boolean = true): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 批量更新库存 类型:${type}, 数据:`, data);
|
||||
|
||||
const result = await WxCloudApi.updateInventory(type, data, merge);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
const targetData = this.getTargetData(type);
|
||||
if (merge) {
|
||||
Object.assign(targetData, data);
|
||||
} else {
|
||||
Object.keys(targetData).forEach(key => delete targetData[key]);
|
||||
Object.assign(targetData, data);
|
||||
}
|
||||
console.log(`[GameDataSyncManager]: 库存批量更新成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 库存批量更新失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 批量更新库存异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置指定类型的库存为默认值
|
||||
* @param type 库存类型 ('items', 'tals', 'equips')
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async resetInventory(type: 'items' | 'tals' | 'equips'): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 重置库存 类型:${type}`);
|
||||
|
||||
const result = await WxCloudApi.resetInventory(type);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
const targetData = this.getTargetData(type);
|
||||
Object.keys(targetData).forEach(key => delete targetData[key]);
|
||||
Object.assign(targetData, result.result.data);
|
||||
console.log(`[GameDataSyncManager]: 库存重置成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 库存重置失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 重置库存异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 便捷方法 ====================
|
||||
|
||||
/**
|
||||
@@ -424,7 +248,22 @@ export class GameDataSyncManager {
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async addItem(itemId: number, count: number): Promise<boolean> {
|
||||
return this.addInventoryItem('items', itemId, count);
|
||||
smc.items[itemId] = (smc.items[itemId] || 0) + count;
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 增加道具 ID:${itemId}, 数量:${count}`);
|
||||
const result = await WxCloudApi.addInventoryItem('items', itemId, count);
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
console.log(`[GameDataSyncManager]: 道具增加成功`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 道具增加失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 增加道具异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -434,9 +273,30 @@ export class GameDataSyncManager {
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async consumeItem(itemId: number, count: number): Promise<boolean> {
|
||||
return this.consumeInventoryItem('items', itemId, count);
|
||||
if(!smc.items[itemId]||smc.items[itemId]<count){
|
||||
oops.gui.toast("道具数量不足")
|
||||
return false
|
||||
}
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 消耗道具 ID:${itemId}, 数量:${count}`);
|
||||
const result = await WxCloudApi.consumeInventoryItem('items', itemId, count);
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
smc.items[itemId] = Math.max(0, (smc.items[itemId] || 0) - count);
|
||||
console.log(`[GameDataSyncManager]: 道具消耗成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 道具消耗失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 消耗道具异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 增加天赋点
|
||||
* @param talId 天赋ID
|
||||
@@ -444,7 +304,24 @@ export class GameDataSyncManager {
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async addTalent(talId: number, count: number): Promise<boolean> {
|
||||
return this.addInventoryItem('tals', talId, count);
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 增加天赋点 ID:${talId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.addInventoryItem('tals', talId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
smc.tals[talId] = (smc.tals[talId] || 0) + count;
|
||||
console.log(`[GameDataSyncManager]: 天赋点增加成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 天赋点增加失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 增加天赋点异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -454,7 +331,51 @@ export class GameDataSyncManager {
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async consumeTalent(talId: number, count: number): Promise<boolean> {
|
||||
return this.consumeInventoryItem('tals', talId, count);
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 消耗天赋点 ID:${talId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.consumeInventoryItem('tals', talId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
smc.tals[talId] = Math.max(0, (smc.tals[talId] || 0) - count);
|
||||
console.log(`[GameDataSyncManager]: 天赋点消耗成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 天赋点消耗失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 消耗天赋点异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置天赋点数量
|
||||
* @param talId 天赋ID
|
||||
* @param count 数量
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async setTalent(talId: number, count: number): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 设置天赋点数量 ID:${talId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.setInventoryItem('tals', talId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
smc.tals[talId] = count;
|
||||
console.log(`[GameDataSyncManager]: 天赋点数量设置成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 天赋点数量设置失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 设置天赋点数量异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -464,7 +385,24 @@ export class GameDataSyncManager {
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async addEquipment(equipId: number, count: number): Promise<boolean> {
|
||||
return this.addInventoryItem('equips', equipId, count);
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 增加装备 ID:${equipId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.addInventoryItem('equips', equipId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
smc.equips[equipId] = (smc.equips[equipId] || 0) + count;
|
||||
console.log(`[GameDataSyncManager]: 装备增加成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 装备增加失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 增加装备异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -474,29 +412,55 @@ export class GameDataSyncManager {
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async consumeEquipment(equipId: number, count: number): Promise<boolean> {
|
||||
return this.consumeInventoryItem('equips', equipId, count);
|
||||
}
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 消耗装备 ID:${equipId}, 数量:${count}`);
|
||||
|
||||
// ==================== 私有辅助方法 ====================
|
||||
const result = await WxCloudApi.consumeInventoryItem('equips', equipId, count);
|
||||
|
||||
/**
|
||||
* 根据类型获取对应的目标数据对象
|
||||
* @param type 库存类型
|
||||
* @returns 对应的数据对象
|
||||
*/
|
||||
private getTargetData(type: 'items' | 'tals' | 'equips'): any {
|
||||
switch (type) {
|
||||
case 'items':
|
||||
return smc.itmes;
|
||||
case 'tals':
|
||||
return smc.tals;
|
||||
case 'equips':
|
||||
return smc.equips;
|
||||
default:
|
||||
throw new Error(`未知的库存类型: ${type}`);
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
smc.equips[equipId] = Math.max(0, (smc.equips[equipId] || 0) - count);
|
||||
console.log(`[GameDataSyncManager]: 装备消耗成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 装备消耗失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 消耗装备异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置装备数量
|
||||
* @param equipId 装备ID
|
||||
* @param count 数量
|
||||
* @returns 是否成功
|
||||
*/
|
||||
async setEquipment(equipId: number, count: number): Promise<boolean> {
|
||||
try {
|
||||
console.log(`[GameDataSyncManager]: 设置装备数量 ID:${equipId}, 数量:${count}`);
|
||||
|
||||
const result = await WxCloudApi.setInventoryItem('equips', equipId, count);
|
||||
|
||||
if (result.result.code === 200) {
|
||||
// 远程修改成功,同步本地数据
|
||||
smc.equips[equipId] = count;
|
||||
console.log(`[GameDataSyncManager]: 装备数量设置成功,本地数据已同步`);
|
||||
return true;
|
||||
} else {
|
||||
console.warn(`[GameDataSyncManager]: 装备数量设置失败: ${result.result.msg}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[GameDataSyncManager]: 设置装备数量异常:`, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 从云端加载所有游戏数据并同步到本地
|
||||
* @returns 是否成功
|
||||
@@ -513,7 +477,7 @@ export class GameDataSyncManager {
|
||||
smc.data = cloudData.data;
|
||||
smc.fight_heros = cloudData.fight_heros;
|
||||
smc.heros = cloudData.heros;
|
||||
smc.itmes = cloudData.items;
|
||||
smc.items = cloudData.items;
|
||||
smc.tals = cloudData.tals;
|
||||
smc.equips = cloudData.equips;
|
||||
|
||||
@@ -545,23 +509,31 @@ export const gameDataSyncManager = GameDataSyncManager.getInstance();
|
||||
使用示例:
|
||||
|
||||
// 1. 出战英雄管理
|
||||
await gameDataSyncManager.setFightHero(0, 5001); // 设置位置0的英雄
|
||||
await gameDataSyncManager.swapFightHeros(0, 1); // 交换位置0和1的英雄
|
||||
await gameDataSyncManager.updateFightHeros({0: 5001, 1: 5005}); // 批量更新
|
||||
await gameDataSyncManager.resetFightHeros(); // 重置为默认配置
|
||||
|
||||
// 2. 英雄管理
|
||||
await gameDataSyncManager.addHero(5008, {uuid: 5008, lv: 1}); // 添加新英雄
|
||||
await gameDataSyncManager.levelUpHero(5001, 5); // 英雄升级5级
|
||||
await gameDataSyncManager.setHeroProperty(5001, "exp", 1000); // 设置英雄经验
|
||||
await gameDataSyncManager.addHero(5008, {uuid: 5008, lv: 1}); // 添加新英雄
|
||||
await gameDataSyncManager.levelUpHero(5001, 100, 50, 5); // 英雄升级5级
|
||||
await gameDataSyncManager.setHeroProperty(5001, "exp", 1000); // 设置英雄经验
|
||||
|
||||
// 3. 库存管理
|
||||
// 3. 道具管理 (items)
|
||||
await gameDataSyncManager.addItem(1001, 10); // 增加道具
|
||||
await gameDataSyncManager.consumeItem(1001, 2); // 消耗道具
|
||||
await gameDataSyncManager.addTalent(2001, 5); // 增加天赋点
|
||||
await gameDataSyncManager.addEquipment(3001, 2); // 增加装备
|
||||
await gameDataSyncManager.consumeItem(1001, 2); // 消耗道具
|
||||
await gameDataSyncManager.setItem(1001, 5); // 设置道具数量
|
||||
|
||||
// 4. 数据加载
|
||||
await gameDataSyncManager.loadAllGameData(); // 从云端加载所有数据
|
||||
// 4. 天赋点管理 (tals)
|
||||
await gameDataSyncManager.addTalent(2001, 5); // 增加天赋点
|
||||
await gameDataSyncManager.consumeTalent(2001, 2); // 消耗天赋点
|
||||
await gameDataSyncManager.setTalent(2001, 10); // 设置天赋点数量
|
||||
|
||||
// 5. 装备管理 (equips)
|
||||
await gameDataSyncManager.addEquipment(3001, 2); // 增加装备
|
||||
await gameDataSyncManager.consumeEquipment(3001, 1); // 消耗装备
|
||||
await gameDataSyncManager.setEquipment(3001, 3); // 设置装备数量
|
||||
|
||||
// 6. 数据加载
|
||||
await gameDataSyncManager.loadAllGameData(); // 从云端加载所有数据
|
||||
|
||||
注意:所有方法都返回 Promise<boolean>,true表示成功,false表示失败
|
||||
只有在远程修改成功后,本地数据才会被同步修改
|
||||
|
||||
@@ -42,7 +42,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
5005:{uuid:5005,lv:1},
|
||||
5007:{uuid:5007,lv:1},
|
||||
};
|
||||
itmes:any={
|
||||
items:any={
|
||||
}
|
||||
tals:any={
|
||||
}
|
||||
@@ -155,6 +155,13 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
/**
|
||||
* 增加游戏数据属性(统一接口)
|
||||
* @param property 属性名
|
||||
* property list:
|
||||
* ***gold:金币
|
||||
* ***diamond:钻石
|
||||
* ***meat:肉
|
||||
* ***exp:经验
|
||||
* ***score:分数
|
||||
* ***mission:关卡
|
||||
* @param value 增加的值
|
||||
* @param autoSave 是否自动保存 (默认true)
|
||||
* @returns 操作结果
|
||||
@@ -221,6 +228,14 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
|
||||
return true;
|
||||
}
|
||||
addItem(item_uuid:number,count:number,autoSave:boolean=true){
|
||||
if(this.isWxClient()){
|
||||
this.gameDataSyncManager.addItem(item_uuid,count);
|
||||
}
|
||||
else{
|
||||
this.items[item_uuid] = (this.items[item_uuid] || 0) + count;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ export enum UIID {
|
||||
HeroInfo,
|
||||
Victory,
|
||||
HeroSelect,
|
||||
ItemInfo,
|
||||
// Shop_Page,
|
||||
// Hero_Page,
|
||||
}
|
||||
@@ -32,6 +33,7 @@ export var UIConfigData: { [key: number]: UIConfig } = {
|
||||
[UIID.HeroInfo]: { layer: LayerType.UI, prefab: "gui/Hinfo" },
|
||||
[UIID.Victory]: { layer: LayerType.UI, prefab: "gui/element/victory" },
|
||||
[UIID.HeroSelect]: { layer: LayerType.UI, prefab: "gui/hero_select" },
|
||||
[UIID.ItemInfo]: { layer: LayerType.UI, prefab: "gui/element/item_info" },
|
||||
// [UIID.Shop_Page]: { layer: LayerType.UI, prefab: "gui/shop_page" },
|
||||
// [UIID.Hero_Page]: { layer: LayerType.UI, prefab: "gui/heros_page" },
|
||||
// [UIID.Toast]: { layer: LayerType.PopUp, prefab: "common/prefab/toast" },
|
||||
|
||||
@@ -1,31 +1,217 @@
|
||||
/*
|
||||
type:
|
||||
1 普通消耗品,武器升级或技能升级原材料
|
||||
2 可双击打开,如宝箱,
|
||||
ghstone:0, //英雄石 绿色 普通英雄升星
|
||||
bhstone:0, //英雄石 蓝色 稀有英雄升星
|
||||
phlestone:0, //英雄石 紫色 史诗英雄升星
|
||||
rhstone:0, //英雄石 红色 传说英雄升星
|
||||
herocard:0, //英雄卡,抽卡凭证
|
||||
ckey:0, //铜钥匙 解锁稀有英雄 也可以直接兑换金币
|
||||
skey:0, //银钥匙 解锁史诗英雄 也可以直接兑换金币
|
||||
gkey:0, //金钥匙 解锁传说英雄 也可以直接兑换金币
|
||||
|
||||
|
||||
*/
|
||||
|
||||
import * as exp from "constants";
|
||||
import { QualitySet } from "./BoxSet";
|
||||
|
||||
|
||||
export const Items={
|
||||
1001:{uuid: 1001,path: "1001",type:1,quality:QualitySet.GREEN,name: "经验药水",info:"增加英雄经验", },
|
||||
1002:{uuid: 1002,path: "1002",type:1,quality:QualitySet.BLUE,name: "绿色英雄石",info:"稀有英雄升星必须材料", },
|
||||
1003:{uuid: 1003,path: "1003",type:1,quality:QualitySet.BLUE,name: "蓝色英雄石",info:"史诗英雄升星必须材料", },
|
||||
1004:{uuid: 1004,path: "1004",type:1,quality:QualitySet.PURPLE,name: "紫色英雄石",info:"传说英雄升星必须材料", },
|
||||
1005:{uuid: 1005,path: "1005",type:1,quality:QualitySet.ORANGE,name: "红色英雄石",info:"传说英雄升星必须材料", },
|
||||
1006:{uuid: 1006,path: "1006",type:1,quality:QualitySet.GREEN,name: "招募劵",info:"可以在英雄酒馆招募英雄", },
|
||||
1007:{uuid: 1007,path: "1007",type:1,quality:QualitySet.BLUE,name: "铜钥匙",info:"解锁稀有英雄 也可以直接兑换金币", },
|
||||
1008:{uuid: 1008,path: "1008",type:1,quality:QualitySet.PURPLE,name: "银钥匙",info:"解锁史诗英雄 也可以直接兑换金币", },
|
||||
1009:{uuid: 1009,path: "1009",type:1,quality:QualitySet.ORANGE,name: "金钥匙",info:"解锁传说英雄 也可以直接兑换金币", },
|
||||
export enum ItemType{
|
||||
NORMAL=0,//普通
|
||||
SPECIAL=1,//特殊 可双击打开
|
||||
EQUIP=2,//装备
|
||||
}
|
||||
|
||||
// 掉落物品接口
|
||||
export interface DropItem {
|
||||
item_uuid: number; // 物品ID
|
||||
probability: number; // 掉落概率 (0-1之间)
|
||||
minCount: number; // 最小掉落数量
|
||||
maxCount: number; // 最大掉落数量
|
||||
baseCount: number; // 基础掉落数量
|
||||
growthRate: number; // 增长参数
|
||||
}
|
||||
|
||||
// 怪物掉落配置接口
|
||||
export interface MonsterDropConfig {
|
||||
monsterId: number; // 怪物ID
|
||||
quality: QualitySet; // 怪物品质
|
||||
drops: DropItem[]; // 掉落物品列表
|
||||
}
|
||||
|
||||
export const Items={
|
||||
1001:{uuid: 1001,path: "1001",type:1,quality:QualitySet.GREEN,name: "绿色英雄石",info:"稀有英雄升星必须材料", },
|
||||
1002:{uuid: 1002,path: "1002",type:1,quality:QualitySet.BLUE,name: "蓝色英雄石",info:"史诗英雄升星必须材料", },
|
||||
1003:{uuid: 1003,path: "1003",type:1,quality:QualitySet.PURPLE,name: "紫色英雄石",info:"传说英雄升星必须材料", },
|
||||
1004:{uuid: 1004,path: "1004",type:1,quality:QualitySet.ORANGE,name: "红色英雄石",info:"传说英雄升星必须材料", },
|
||||
1005:{uuid: 1005,path: "1005",type:1,quality:QualitySet.ORANGE,name: "招募劵",info:"可以在英雄酒馆招募英雄", },
|
||||
1006:{uuid: 1006,path: "1006",type:1,quality:QualitySet.BLUE,name: "铜钥匙",info:"解锁稀有英雄 也可以直接兑换金币", },
|
||||
1007:{uuid: 1007,path: "1007",type:1,quality:QualitySet.PURPLE,name: "银钥匙",info:"解锁史诗英雄 也可以直接兑换金币", },
|
||||
1008:{uuid: 1008,path: "1008",type:1,quality:QualitySet.ORANGE,name: "金钥匙",info:"解锁传说英雄 也可以直接兑换金币", },
|
||||
}
|
||||
|
||||
export enum DropKey{
|
||||
ItemUUId=0, // 物品ID
|
||||
Pro=1, // 概率
|
||||
Diff=2, // 上下限差值
|
||||
Base=3, // 基础数量
|
||||
GrowthRate=4, // 增长参数
|
||||
}
|
||||
|
||||
// 怪物掉落配置表 - 按照DropKey顺序配置
|
||||
export const MonsterDropTable: { [monsterId: number]: [number, number, number, number, number][] } = {
|
||||
// 普通怪物 - 绿色品质
|
||||
5201: [ // 兽人战士
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.3, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 30%概率掉落铜钥匙
|
||||
],
|
||||
5202: [ // 兽人刺客
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.4, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 40%概率掉落铜钥匙
|
||||
],
|
||||
5203: [ // 兽人护卫
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.3, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 30%概率掉落铜钥匙
|
||||
],
|
||||
5204: [ // 石卫
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.35, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 35%概率掉落铜钥匙
|
||||
],
|
||||
5205: [ // 土卫
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.35, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 35%概率掉落铜钥匙
|
||||
],
|
||||
5206: [ // 树卫
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.35, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 35%概率掉落铜钥匙
|
||||
],
|
||||
5219: [ // 牛头战士
|
||||
[Items[1001].uuid, 1.0, 1, 1, 0.25], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1-2个绿色英雄石
|
||||
[Items[1006].uuid, 0.4, 0, 1, 0.15] // [item_uuid, probability, diff, baseCount, growthRate] - 40%概率掉落铜钥匙
|
||||
],
|
||||
5220: [ // 牛头战士
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.3, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 30%概率掉落铜钥匙
|
||||
],
|
||||
5221: [ // 牛头战士
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.4, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 40%概率掉落铜钥匙
|
||||
],
|
||||
5222: [ // 独眼巨人
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.3, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 30%概率掉落铜钥匙
|
||||
],
|
||||
5223: [ // 独眼巨人
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.3, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 30%概率掉落铜钥匙
|
||||
],
|
||||
5224: [ // 独眼巨人
|
||||
[Items[1001].uuid, 1.0, 0, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个绿色英雄石
|
||||
[Items[1006].uuid, 0.4, 0, 1, 0.1] // [item_uuid, probability, diff, baseCount, growthRate] - 40%概率掉落铜钥匙
|
||||
],
|
||||
|
||||
// 精英怪物 - 蓝色品质
|
||||
5225: [ // 精英独眼
|
||||
[Items[1001].uuid, 1.0, 1, 2, 0.3], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落2-3个绿色英雄石
|
||||
[Items[1002].uuid, 1.0, 0, 1, 0.25], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个蓝色英雄石
|
||||
[Items[1006].uuid, 0.6, 1, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 60%概率掉落铜钥匙
|
||||
[Items[1007].uuid, 0.2, 0, 1, 0.15] // [item_uuid, probability, diff, baseCount, growthRate] - 20%概率掉落银钥匙
|
||||
],
|
||||
5226: [ // 精英牛头
|
||||
[Items[1001].uuid, 1.0, 1, 2, 0.3], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落2-3个绿色英雄石
|
||||
[Items[1002].uuid, 1.0, 0, 1, 0.25], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个蓝色英雄石
|
||||
[Items[1006].uuid, 0.6, 1, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 60%概率掉落铜钥匙
|
||||
[Items[1007].uuid, 0.2, 0, 1, 0.15] // [item_uuid, probability, diff, baseCount, growthRate] - 20%概率掉落银钥匙
|
||||
],
|
||||
5227: [ // 精英兽人
|
||||
[Items[1001].uuid, 1.0, 1, 2, 0.3], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落2-3个绿色英雄石
|
||||
[Items[1002].uuid, 1.0, 0, 1, 0.25], // [item_uuid, probability, diff, baseCount, growthRate] - 100%掉落1个蓝色英雄石
|
||||
[Items[1006].uuid, 0.6, 1, 1, 0.2], // [item_uuid, probability, diff, baseCount, growthRate] - 60%概率掉落铜钥匙
|
||||
[Items[1007].uuid, 0.2, 0, 1, 0.15] // [item_uuid, probability, diff, baseCount, growthRate] - 20%概率掉落银钥匙
|
||||
]
|
||||
};
|
||||
|
||||
// 怪物掉落管理器
|
||||
export class MonsterDropManager {
|
||||
|
||||
/**
|
||||
* 根据怪物ID获取掉落配置
|
||||
* @param monsterId 怪物ID
|
||||
* @returns 掉落配置
|
||||
*/
|
||||
static getDropConfig(monsterId: number): [number, number, number, number, number][] | null {
|
||||
return MonsterDropTable[monsterId] || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算指定关卡数的掉落数量
|
||||
* @param baseCount 基础数量
|
||||
* @param growthRate 增长参数
|
||||
* @param stageNumber 关卡数
|
||||
* @param diff 上下限差值
|
||||
* @returns 计算后的掉落数量
|
||||
*/
|
||||
static calculateDropCount(baseCount: number, growthRate: number, stageNumber: number, diff: number): number {
|
||||
// 公式:基础数量 * 增长参数 * 关卡数 + (0-差值的随机数)
|
||||
const calculatedCount = baseCount * growthRate * stageNumber;
|
||||
const randomBonus = Math.floor(Math.random() * (diff + 1)); // 0到diff的随机数
|
||||
const finalCount = calculatedCount + randomBonus;
|
||||
|
||||
// 允许掉落数量为0
|
||||
return Math.max(0, Math.floor(finalCount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算怪物掉落物品
|
||||
* @param monsterId 怪物ID
|
||||
* @param stageNumber 关卡数
|
||||
* @param playerLuck 玩家幸运值加成
|
||||
* @returns 掉落物品数组
|
||||
*/
|
||||
static calculateMonsterDrops(monsterId: number, stageNumber: number, playerLuck: number = 0): Array<{item_uuid: number, count: number}> {
|
||||
const dropArray = this.getDropConfig(monsterId);
|
||||
if (!dropArray) {
|
||||
console.warn(`[MonsterDropManager]: No drop config found for monster ${monsterId}`);
|
||||
return [];
|
||||
}
|
||||
|
||||
const result: Array<{item_uuid: number, count: number}> = [];
|
||||
const luckBonus = 1 + (playerLuck * 0.01); // 幸运值加成
|
||||
|
||||
// 处理所有掉落物品(统一按概率处理)
|
||||
dropArray.forEach(dropData => {
|
||||
const [item_uuid, probability, diff, baseCount, growthRate] = dropData;
|
||||
|
||||
if (Math.random() < probability) {
|
||||
// 使用新的计算公式:基础值*关卡数*增长参数+(0-差值的随机数)
|
||||
const finalCount = this.calculateDropCount(baseCount, growthRate, stageNumber, diff);
|
||||
const countWithLuck = Math.floor(finalCount * luckBonus);
|
||||
|
||||
result.push({
|
||||
item_uuid: item_uuid,
|
||||
count: Math.max(1, countWithLuck) // 确保至少掉落1个
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预览指定关卡数的掉落数量(不包含随机因素)
|
||||
* @param monsterId 怪物ID
|
||||
* @param stageNumber 关卡数
|
||||
* @returns 掉落物品预览数组
|
||||
*/
|
||||
static previewMonsterDrops(monsterId: number, stageNumber: number): Array<{item_uuid: number, baseCount: number, calculatedCount: number, maxCount: number}> {
|
||||
const dropArray = this.getDropConfig(monsterId);
|
||||
if (!dropArray) {
|
||||
console.warn(`[MonsterDropManager]: No drop config found for monster ${monsterId}`);
|
||||
return [];
|
||||
}
|
||||
|
||||
const result: Array<{item_uuid: number, baseCount: number, calculatedCount: number, maxCount: number}> = [];
|
||||
|
||||
// 处理所有掉落物品
|
||||
dropArray.forEach(dropData => {
|
||||
const [item_uuid, probability, diff, baseCount, growthRate] = dropData;
|
||||
const calculatedCount = baseCount * growthRate * stageNumber;
|
||||
const maxCount = calculatedCount + diff;
|
||||
|
||||
result.push({
|
||||
item_uuid: item_uuid,
|
||||
baseCount: baseCount,
|
||||
calculatedCount: Math.floor(calculatedCount),
|
||||
maxCount: Math.floor(maxCount)
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import { EquipSpecialAttr } from "../common/config/Equips";
|
||||
import { FightSet, getExpDrops, getStoneDrops, TooltipTypes } from "../common/config/Mission";
|
||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||
import { EnhancementType } from "../common/config/LevelUp";
|
||||
import { MonsterDropManager } from "../common/config/Items";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -254,11 +255,16 @@ export class HeroViewComp extends CCComp {
|
||||
this.is_count_dead=true
|
||||
if(this.fac==FacSet.MON){
|
||||
this.scheduleOnce(()=>{
|
||||
oops.message.dispatchEvent(GameEvent.MonDead)
|
||||
let drop_item=this.do_drop()
|
||||
if(drop_item.length>0){
|
||||
oops.message.dispatchEvent(GameEvent.MonDead,{mon_uuid:this.hero_uuid,drops:drop_item})
|
||||
}
|
||||
},0.1)
|
||||
}
|
||||
if(this.fac==FacSet.HERO){
|
||||
oops.message.dispatchEvent(GameEvent.HeroDead)
|
||||
this.scheduleOnce(()=>{
|
||||
oops.message.dispatchEvent(GameEvent.HeroDead,{hero_uuid:this.hero_uuid})
|
||||
},0.1)
|
||||
}
|
||||
|
||||
if(this.fac==FacSet.HERO){
|
||||
@@ -268,7 +274,11 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
|
||||
}
|
||||
|
||||
do_drop(){
|
||||
let drop_item=MonsterDropManager.calculateMonsterDrops(this.hero_uuid,smc.data.mission,1)
|
||||
console.log("[HeroViewComp]:do_drop",this.hero_uuid,drop_item)
|
||||
return drop_item
|
||||
}
|
||||
add_debuff(type:number,deV:number,deC:number,deR:number){
|
||||
let n_deR=deR-this.Attrs[BuffAttr.DEBUFF_DOWN]
|
||||
let r=RandomManager.instance.getRandomInt(0,100) // 随机数
|
||||
|
||||
@@ -52,7 +52,7 @@ export class SkillConComp extends CCComp {
|
||||
}
|
||||
if(skills[1]){
|
||||
if(this.HeroView.fac==FacSet.HERO) {
|
||||
console.log("[SkillConComp] 角色状态:",this.HeroView.hero_name+"=>能量:"+this.HeroView.power+"/"+this.HeroView.power_max,skills)
|
||||
// console.log("[SkillConComp] 角色状态:",this.HeroView.hero_name+"=>能量:"+this.HeroView.power+"/"+this.HeroView.power_max,skills)
|
||||
}
|
||||
this.HeroView.power+=(1+this.HeroView.Attrs[BuffAttr.POWER_UP])*dt*SKILL_CONST.POWER_UP
|
||||
let progress=this.HeroView.power/this.HeroView.power_max
|
||||
@@ -223,7 +223,7 @@ export class SkillConComp extends CCComp {
|
||||
|
||||
onDestroy() {
|
||||
// 清理所有定时器
|
||||
console.log("[SkillConComp]:onDestroy:",this.node.name)
|
||||
// console.log("[SkillConComp]:onDestroy:",this.node.name)
|
||||
Object.values(this._timers).forEach(clearTimeout);
|
||||
this._timers = {};
|
||||
// 移除事件监听
|
||||
|
||||
222
assets/script/game/map/ItemComp.ts
Normal file
222
assets/script/game/map/ItemComp.ts
Normal file
@@ -0,0 +1,222 @@
|
||||
import { _decorator, Component, Node, Label, Sprite, resources, SpriteFrame } from 'cc';
|
||||
import { Items } from '../common/config/Items';
|
||||
import { QualitySet } from '../common/config/BoxSet';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
import { UIID } from '../common/config/GameUIConfig';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ItemComp')
|
||||
export class ItemComp extends Component {
|
||||
item_uuid: number = 0;
|
||||
item_count: number = 1;
|
||||
type: number = 0;
|
||||
slot: number = 0;
|
||||
no_show:boolean=false
|
||||
|
||||
|
||||
|
||||
start() {
|
||||
console.log("[ItemComp]:start");
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新物品数据
|
||||
* @param hero_uuid 物品ID
|
||||
* @param count 物品数量
|
||||
* @param args 额外参数
|
||||
*/
|
||||
update_data(hero_uuid: number, count: number = 1, args: any = {}) {
|
||||
this.item_uuid = hero_uuid;
|
||||
this.item_count = count;
|
||||
this.type = args.type || 0;
|
||||
this.slot = args.slot || 0;
|
||||
this.no_show = args.no_show || false;
|
||||
console.log("[ItemComp]:update_data", hero_uuid, count, this.type, this.slot, args);
|
||||
|
||||
// 获取物品配置
|
||||
const itemData = Items[hero_uuid];
|
||||
if (!itemData) {
|
||||
console.error("[ItemComp]: Item not found", hero_uuid);
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置物品图标
|
||||
this.setItemIcon(itemData.path);
|
||||
|
||||
// 设置品质边框
|
||||
this.setQualityFrame(itemData.quality);
|
||||
|
||||
// 设置数量显示
|
||||
this.setItemCount(count);
|
||||
|
||||
// 设置选中状态
|
||||
if (args.selected) {
|
||||
this.setSelected(true);
|
||||
} else {
|
||||
this.setSelected(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置物品图标
|
||||
* @param iconPath 图标路径
|
||||
*/
|
||||
private setItemIcon(iconPath: string) {
|
||||
let path=`gui/items/${iconPath}`
|
||||
console.log("[ItemComp]: setItemIcon", path);
|
||||
resources.load(path, SpriteFrame, (err, spriteFrame) => {
|
||||
if (err) {
|
||||
console.error("[ItemComp]: Failed to load item icon", iconPath, err);
|
||||
return;
|
||||
}
|
||||
console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
|
||||
this.node.getChildByName("icon").getComponent(Sprite)!.spriteFrame = spriteFrame;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置品质边框
|
||||
* @param quality 品质类型
|
||||
*/
|
||||
private setQualityFrame(quality: QualitySet) {
|
||||
// 隐藏所有品质边框
|
||||
this.hideAllQualityFrames();
|
||||
|
||||
// 根据品质显示对应边框
|
||||
switch (quality) {
|
||||
case QualitySet.GREEN:
|
||||
this.node.getChildByName("q1").active = true;
|
||||
break;
|
||||
case QualitySet.BLUE:
|
||||
this.node.getChildByName("q2").active = true;
|
||||
break;
|
||||
case QualitySet.PURPLE:
|
||||
this.node.getChildByName("q3").active = true;
|
||||
break;
|
||||
case QualitySet.ORANGE:
|
||||
this.node.getChildByName("q4").active = true;
|
||||
break;
|
||||
default:
|
||||
// 默认使用绿色边框
|
||||
this.node.getChildByName("q").active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏所有品质边框
|
||||
*/
|
||||
private hideAllQualityFrames() {
|
||||
this.node.getChildByName("q").active = false;
|
||||
this.node.getChildByName("q1").active = false;
|
||||
this.node.getChildByName("q2").active = false;
|
||||
this.node.getChildByName("q3").active = false;
|
||||
this.node.getChildByName("q4").active = false;
|
||||
this.node.getChildByName("focus").active = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置物品数量
|
||||
* @param count 数量
|
||||
*/
|
||||
private setItemCount(count: number) {
|
||||
this.node.getChildByName("num").getComponent(Label)!.string = count.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置选中状态
|
||||
* @param selected 是否选中
|
||||
*/
|
||||
private setSelected(selected: boolean) {
|
||||
this.node.getChildByName("focus").active = selected;
|
||||
}
|
||||
|
||||
/**
|
||||
* 物品点击事件
|
||||
*/
|
||||
do_click() {
|
||||
console.log("[ItemComp]: Item clicked", this.item_uuid, this.item_count);
|
||||
|
||||
// 根据类型处理不同逻辑
|
||||
switch (this.type) {
|
||||
case 1: // 普通点击
|
||||
this.onItemClick();
|
||||
break;
|
||||
case 2: // 选择物品
|
||||
this.onItemSelect();
|
||||
break;
|
||||
case 3: // 使用物品
|
||||
this.onItemUse();
|
||||
break;
|
||||
default:
|
||||
this.onItemClick();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通物品点击
|
||||
*/
|
||||
private onItemClick() {
|
||||
// 显示物品信息或执行其他逻辑
|
||||
console.log("[ItemComp]: Show item info", this.item_uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择物品
|
||||
*/
|
||||
private onItemSelect() {
|
||||
// 处理物品选择逻辑
|
||||
console.log("[ItemComp]: Item selected", this.item_uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用物品
|
||||
*/
|
||||
private onItemUse() {
|
||||
// 处理物品使用逻辑
|
||||
console.log("[ItemComp]: Use item", this.item_uuid);
|
||||
}
|
||||
show_item_info(){
|
||||
if(this.no_show){
|
||||
return
|
||||
}
|
||||
oops.gui.open(UIID.ItemInfo, { item_uuid: this.item_uuid ,count:this.item_count});
|
||||
}
|
||||
/**
|
||||
* 获取物品UUID
|
||||
*/
|
||||
getItemUUID(): number {
|
||||
return this.item_uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物品数量
|
||||
*/
|
||||
getItemCount(): number {
|
||||
return this.item_count;
|
||||
}
|
||||
addItemCount(count:number){
|
||||
this.item_count+=count
|
||||
this.setItemCount(this.item_count)
|
||||
}
|
||||
/**
|
||||
* 设置物品类型
|
||||
*/
|
||||
setItemType(type: number) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置物品槽位
|
||||
*/
|
||||
setItemSlot(slot: number) {
|
||||
this.slot = slot;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/map/ItemComp.ts.meta
Normal file
9
assets/script/game/map/ItemComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "691f8376-3937-42db-ae4b-771d4cc67b25",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
295
assets/script/game/map/ItemInfoComp.ts
Normal file
295
assets/script/game/map/ItemInfoComp.ts
Normal file
@@ -0,0 +1,295 @@
|
||||
import { _decorator, Component, Node, Label, Sprite, resources, SpriteFrame, input, Input, EventTouch, EventMouse, Vec3, Vec2, UITransform, Color } from 'cc';
|
||||
import { Items } from '../common/config/Items';
|
||||
import { QualitySet } from '../common/config/BoxSet';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ItemInfoComp')
|
||||
export class ItemInfoComp extends Component {
|
||||
item_uuid: number = 0;
|
||||
item_count: number = 1;
|
||||
|
||||
// 触摸监听相关
|
||||
private touchListener: any = null;
|
||||
private isListening: boolean = false;
|
||||
|
||||
start() {
|
||||
console.log("[ItemInfoComp]:start");
|
||||
}
|
||||
|
||||
onAdded(args: any) {
|
||||
console.log("[ItemInfoComp]:onAdded", args);
|
||||
this.setupTouchListener();
|
||||
this.update_data(args);
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
this.removeTouchListener();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置触摸监听
|
||||
*/
|
||||
private setupTouchListener() {
|
||||
if (this.isListening) return;
|
||||
// 监听触摸开始事件
|
||||
this.touchListener = input.on(Input.EventType.TOUCH_START, this.onTouchStart, this);
|
||||
this.isListening = true;
|
||||
|
||||
console.log("[ItemInfoComp]: Touch listener setup");
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除触摸监听
|
||||
*/
|
||||
private removeTouchListener() {
|
||||
if (this.touchListener && this.isListening) {
|
||||
input.off(Input.EventType.TOUCH_START, this.onTouchStart, this);
|
||||
this.isListening = false;
|
||||
this.touchListener = null;
|
||||
|
||||
console.log("[ItemInfoComp]: Touch listener removed");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 触摸开始事件处理
|
||||
* @param event 触摸事件
|
||||
*/
|
||||
private onTouchStart(event: EventTouch) {
|
||||
const touchPos = event.getLocation();
|
||||
const nodePos = this.node.getWorldPosition();
|
||||
|
||||
// 检查触摸点是否在弹窗范围内
|
||||
if (!this.isTouchInNodeBounds(touchPos, nodePos)) {
|
||||
console.log("[ItemInfoComp]: Touch outside bounds, closing popup");
|
||||
this.closeItemInfo();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查触摸点是否在节点范围内
|
||||
* @param touchPos 触摸点世界坐标
|
||||
* @param nodePos 节点世界坐标
|
||||
* @returns 是否在范围内
|
||||
*/
|
||||
private isTouchInNodeBounds(touchPos: Vec2, nodePos: Vec3): boolean {
|
||||
const nodeSize = this.node.getComponent(UITransform)?.contentSize;
|
||||
if (!nodeSize) return false;
|
||||
|
||||
// 计算节点的边界
|
||||
const halfWidth = nodeSize.width * 0.5;
|
||||
const halfHeight = nodeSize.height * 0.5;
|
||||
|
||||
// 检查触摸点是否在节点范围内
|
||||
const inX = Math.abs(touchPos.x - nodePos.x) <= halfWidth;
|
||||
const inY = Math.abs(touchPos.y - nodePos.y) <= halfHeight;
|
||||
|
||||
return inX && inY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新物品数据
|
||||
* @param args 物品参数 {item_uuid: number, count?: number}
|
||||
*/
|
||||
update_data(args: any) {
|
||||
console.log("[ItemInfoComp]:update_data", args);
|
||||
|
||||
if (!args || !args.item_uuid) {
|
||||
console.error("[ItemInfoComp]: Invalid args", args);
|
||||
return;
|
||||
}
|
||||
|
||||
this.item_uuid = args.item_uuid;
|
||||
this.item_count = args.count || 1;
|
||||
|
||||
// 获取物品配置
|
||||
const itemData = Items[this.item_uuid];
|
||||
if (!itemData) {
|
||||
console.error("[ItemInfoComp]: Item not found", this.item_uuid);
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置物品图标
|
||||
this.setItemIcon(itemData.path);
|
||||
|
||||
// 设置品质边框
|
||||
this.setQualityFrame(itemData.quality);
|
||||
|
||||
// 设置品质文字描述
|
||||
this.setQualityText(itemData.quality);
|
||||
|
||||
// 设置数量显示
|
||||
this.setItemCount(this.item_count);
|
||||
|
||||
// 设置物品名称
|
||||
this.setItemName(itemData.name);
|
||||
|
||||
// 设置物品描述
|
||||
this.setItemInfo(itemData.info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置物品图标
|
||||
* @param iconPath 图标路径
|
||||
*/
|
||||
private setItemIcon(iconPath: string) {
|
||||
let path=`gui/items/${iconPath}`
|
||||
console.log("[ItemComp]: setItemIcon", path);
|
||||
resources.load(path, SpriteFrame, (err, spriteFrame) => {
|
||||
if (err) {
|
||||
console.error("[ItemComp]: Failed to load item icon", iconPath, err);
|
||||
return;
|
||||
}
|
||||
console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
|
||||
this.node.getChildByName("item").getChildByName("icon").getComponent(Sprite)!.spriteFrame = spriteFrame;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置品质边框
|
||||
* @param quality 品质类型
|
||||
*/
|
||||
private setQualityFrame(quality: QualitySet) {
|
||||
// 隐藏所有品质边框
|
||||
this.hideAllQualityFrames();
|
||||
|
||||
// 根据品质显示对应边框
|
||||
switch (quality) {
|
||||
case QualitySet.GREEN:
|
||||
this.node.getChildByName("item").getChildByName("q1").active = true;
|
||||
break;
|
||||
case QualitySet.BLUE:
|
||||
this.node.getChildByName("item").getChildByName("q2").active = true;
|
||||
break;
|
||||
case QualitySet.PURPLE:
|
||||
this.node.getChildByName("item").getChildByName("q3").active = true;
|
||||
break;
|
||||
case QualitySet.ORANGE:
|
||||
this.node.getChildByName("item").getChildByName("q4").active = true;
|
||||
break;
|
||||
default:
|
||||
// 默认使用绿色边框
|
||||
this.node.getChildByName("item").getChildByName("q").active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏所有品质边框
|
||||
*/
|
||||
private hideAllQualityFrames() {
|
||||
this.node.getChildByName("item").getChildByName("q").active = false;
|
||||
this.node.getChildByName("item").getChildByName("q1").active = false;
|
||||
this.node.getChildByName("item").getChildByName("q2").active = false;
|
||||
this.node.getChildByName("item").getChildByName("q3").active = false;
|
||||
this.node.getChildByName("item").getChildByName("q4").active = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置物品数量
|
||||
* @param count 数量
|
||||
*/
|
||||
private setItemCount(count: number) {
|
||||
if (count > 1) {
|
||||
this.node.getChildByName("item").getChildByName("num").getComponent(Label)!.string = count.toString();
|
||||
this.node.getChildByName("item").getChildByName("num").active = true;
|
||||
} else {
|
||||
this.node.getChildByName("item").getChildByName("num").active = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置物品名称
|
||||
* @param name 物品名称
|
||||
*/
|
||||
private setItemName(name: string) {
|
||||
this.node.getChildByName("name").getComponent(Label)!.string = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置物品描述
|
||||
* @param info 物品描述
|
||||
*/
|
||||
private setItemInfo(info: string) {
|
||||
this.node.getChildByName("info").getComponent(Label)!.string = info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置品质文字描述
|
||||
* @param quality 品质类型
|
||||
*/
|
||||
private setQualityText(quality: QualitySet) {
|
||||
|
||||
switch (quality) {
|
||||
case QualitySet.GREEN:
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.string = "优秀";
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.color = new Color(76, 175, 80, 255); // 现代绿色
|
||||
break;
|
||||
case QualitySet.BLUE:
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.string = "精良";
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.color = new Color(33, 150, 243, 255); // 现代蓝色
|
||||
break;
|
||||
case QualitySet.PURPLE:
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.string = "史诗";
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.color = new Color(156, 39, 176, 255); // 现代紫色
|
||||
break;
|
||||
case QualitySet.ORANGE:
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.string = "传说";
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.color = new Color(255, 87, 34, 255); // 现代橙色
|
||||
break;
|
||||
default:
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.string = "普通";
|
||||
this.node.getChildByName("quality").getChildByName("Label").getComponent(Label)!.color = new Color(158, 158, 158, 255); // 现代灰色
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物品UUID
|
||||
*/
|
||||
getItemUUID(): number {
|
||||
return this.item_uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物品数量
|
||||
*/
|
||||
getItemCount(): number {
|
||||
return this.item_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭物品信息弹窗
|
||||
*/
|
||||
closeItemInfo() {
|
||||
console.log("[ItemInfoComp]: Close item info");
|
||||
this.removeTouchListener();
|
||||
oops.gui.removeByNode(this.node)
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用物品
|
||||
*/
|
||||
useItem() {
|
||||
console.log("[ItemInfoComp]: Use item", this.item_uuid);
|
||||
// 这里可以添加使用物品的逻辑
|
||||
// 比如消耗物品、触发效果等
|
||||
}
|
||||
|
||||
/**
|
||||
* 丢弃物品
|
||||
*/
|
||||
dropItem() {
|
||||
console.log("[ItemInfoComp]: Drop item", this.item_uuid);
|
||||
// 这里可以添加丢弃物品的逻辑
|
||||
// 比如从背包中移除、显示确认对话框等
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/map/ItemInfoComp.ts.meta
Normal file
9
assets/script/game/map/ItemInfoComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "627ed4fe-6a6c-4591-96fb-df08a6ebed95",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,tween,UITransform,v3, Vec3,Animation, UI, instantiate, Prefab, screen } from "cc";
|
||||
import { _decorator, Vec3,Animation, instantiate, Prefab, Node } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
@@ -10,6 +10,7 @@ import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { MonModelComp } from "../hero/MonModelComp";
|
||||
import { SkillCom } from "../skills/SkillCom";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -22,7 +23,7 @@ export class MissionComp extends CCComp {
|
||||
// VictoryComp:any = null;
|
||||
// reward:number = 0;
|
||||
// reward_num:number = 0;
|
||||
|
||||
rewards:any[]=[]
|
||||
|
||||
onLoad(){
|
||||
this.on(GameEvent.MissionStart,this.mission_start,this)
|
||||
@@ -45,10 +46,61 @@ export class MissionComp extends CCComp {
|
||||
do_reward(){
|
||||
// 奖励发放
|
||||
}
|
||||
|
||||
do_mon_dead(){
|
||||
do_drop(drop_item:any[]){
|
||||
console.log("[MissionComp] do_drop",drop_item)
|
||||
let parent=this.node.getChildByName("reward").getChildByName("items")
|
||||
let items=parent.children
|
||||
if(drop_item.length>0){
|
||||
for(let i=0;i<drop_item.length;i++){
|
||||
let d_item=drop_item[i]
|
||||
// 查找是否已存在该物品
|
||||
const existingItem = this.rewards.find(item => item.item_uuid === d_item.item_uuid);
|
||||
if(existingItem){
|
||||
// 如果已存在该物品,累加数量
|
||||
existingItem.count += d_item.count;
|
||||
}else{
|
||||
// 如果不存在该物品,添加新物品
|
||||
this.rewards.push({item_uuid: d_item.item_uuid, count: d_item.count});
|
||||
}
|
||||
}
|
||||
}
|
||||
for(let i=0;i<items.length;i++){
|
||||
let hitem=items[i].getComponent(ItemComp)
|
||||
for(let j=0;j<drop_item.length;j++){
|
||||
let d_item=drop_item[j]
|
||||
if(d_item.item_uuid==hitem.item_uuid){
|
||||
hitem.addItemCount(d_item.count)
|
||||
drop_item.splice(j,1)
|
||||
smc.addItem(d_item.item_uuid,d_item.count)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if(drop_item.length>0){
|
||||
console.log("[MissionComp] do_drop 剩余物品",drop_item)
|
||||
for(let i=0;i<drop_item.length;i++){
|
||||
let d_item=drop_item[i]
|
||||
let path="game/gui/item"
|
||||
const prefab = oops.res.get(path, Prefab);
|
||||
if (!prefab) {
|
||||
console.error("[MissionComp=>do_drop] 预制体加载失败:", path);
|
||||
return;
|
||||
}
|
||||
const node = instantiate(prefab) as unknown as Node;
|
||||
node.parent=parent
|
||||
node.getComponent(ItemComp)!.update_data(d_item.item_uuid,d_item.count)
|
||||
smc.addItem(d_item.item_uuid,d_item.count)
|
||||
}
|
||||
}
|
||||
}
|
||||
do_mon_dead(event:any,data:any){
|
||||
console.log("[MissionComp] do_mon_dead",event,data)
|
||||
smc.vmdata.mission_data.mon_num--
|
||||
console.log("[MissionComp] do_mon_dead",smc.vmdata.mission_data.mon_num)
|
||||
if(data.drops){
|
||||
if(data.drops.length>0){
|
||||
this.do_drop(data.drops)
|
||||
}
|
||||
}
|
||||
if(smc.vmdata.mission_data.mon_num<=0) {
|
||||
smc.vmdata.mission_data.level++
|
||||
if(smc.vmdata.mission_data.level < smc.vmdata.mission_data.max_mission){
|
||||
@@ -57,15 +109,16 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
smc.addGameProperty("mission",1)
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:true})
|
||||
oops.gui.open(UIID.Victory,{victory:true})
|
||||
oops.gui.open(UIID.Victory,{victory:true,rewards:this.rewards})
|
||||
}
|
||||
}
|
||||
do_hero_dead(){
|
||||
|
||||
do_hero_dead(event:any,data:any){
|
||||
console.log("[MissionComp] do_hero_dead",event,data)
|
||||
smc.vmdata.mission_data.hero_num--
|
||||
console.log("[MissionComp] do_hero_dead",smc.vmdata.mission_data.hero_num)
|
||||
if(smc.vmdata.mission_data.hero_num<=0) {
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||
oops.gui.open(UIID.Victory,{victory:false})
|
||||
oops.gui.open(UIID.Victory,{victory:false,rewards:this.rewards})
|
||||
}
|
||||
}
|
||||
do_ad(){
|
||||
@@ -109,7 +162,7 @@ export class MissionComp extends CCComp {
|
||||
|
||||
to_end_fight(){
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||
oops.gui.open(UIID.Victory,{victory:false})
|
||||
oops.gui.open(UIID.Victory,{victory:false,rewards:this.rewards})
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +188,8 @@ export class MissionComp extends CCComp {
|
||||
smc.vmdata.mission_data.in_fight=false
|
||||
smc.vmdata.mission_data.fight_time=0
|
||||
smc.vmdata.mission_data.level=0
|
||||
this.rewards=[] // 改为数组,用于存储掉落物品列表
|
||||
this.node.getChildByName("reward").getChildByName("items").removeAllChildren()
|
||||
console.log("[MissionComp]局内数据初始化",smc.vmdata.mission_data)
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,13 @@ export class MissionHomeComp extends CCComp {
|
||||
uodate_data(){
|
||||
smc.syncData()
|
||||
}
|
||||
isWxClient(){
|
||||
return typeof wx !== 'undefined' && typeof (wx as any).getSystemInfoSync === 'function';
|
||||
}
|
||||
btn_func(e:string,data:any){
|
||||
smc.syncDataFromLocal() //调试用,正式环境去掉
|
||||
if(!this.isWxClient()){
|
||||
smc.syncDataFromLocal() //调试用,正式环境去掉
|
||||
}
|
||||
// console.log("[MissionHomeComp]:btn_func",e,data)
|
||||
let page_heros=this.node.getChildByName("heros_page")
|
||||
let page_shop=this.node.getChildByName("shop_page")
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { _decorator, instantiate, Label ,Prefab,resources,Sprite,SpriteAtlas,v3} from "cc";
|
||||
import { _decorator, instantiate, Label ,Prefab,Node} from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -14,13 +15,18 @@ export class VictoryComp extends CCComp {
|
||||
|
||||
reward_lv:number=1
|
||||
reward_num:number=2
|
||||
rewards:any[]=[]
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
protected onLoad(): void {
|
||||
|
||||
}
|
||||
|
||||
onAdded(args: any) {
|
||||
console.log("[VictoryComp] onAdded",args)
|
||||
console.log("[VictoryComp] onAdded",args,smc.items)
|
||||
if(args.rewards){
|
||||
this.add_reward(args.rewards)
|
||||
this.rewards=args.rewards
|
||||
}
|
||||
this.node.getChildByName("title").getChildByName("victory").active=args.victory
|
||||
this.node.getChildByName("title").getChildByName("defeat").active=!args.victory
|
||||
this.node.getChildByName("btns").getChildByName("next").active=false
|
||||
@@ -29,12 +35,39 @@ export class VictoryComp extends CCComp {
|
||||
},0.2)
|
||||
}
|
||||
|
||||
|
||||
add_reward(rewards:any[]){
|
||||
let parent=this.node.getChildByName("box").getChildByName("items")
|
||||
let items=parent.children
|
||||
for(let i=0;i<rewards.length;i++){
|
||||
let d_item=rewards[i]
|
||||
let path="game/gui/item"
|
||||
const prefab = oops.res.get(path, Prefab);
|
||||
if (!prefab) {
|
||||
console.error("[MissionComp=>do_drop] 预制体加载失败:", path);
|
||||
return;
|
||||
}
|
||||
const node = instantiate(prefab) as unknown as Node;
|
||||
node.parent=parent
|
||||
node.getComponent(ItemComp)!.update_data(d_item.item_uuid,d_item.count,{no_show:true})
|
||||
}
|
||||
}
|
||||
victory_end(){
|
||||
oops.message.dispatchEvent(GameEvent.MissionEnd)
|
||||
oops.gui.removeByNode(this.node)
|
||||
}
|
||||
|
||||
//看广告双倍
|
||||
watch_ad(){
|
||||
return true
|
||||
}
|
||||
double_reward(){
|
||||
if(this.watch_ad()){
|
||||
this.rewards.forEach(d_item=>{
|
||||
smc.addItem(d_item.item_uuid,d_item.count)
|
||||
})
|
||||
this.node.getChildByName("btns").getChildByName("double").active=false
|
||||
}
|
||||
console.log("[VictoryComp]double_reward",smc.items,this.rewards)
|
||||
}
|
||||
restart(){
|
||||
oops.message.dispatchEvent(GameEvent.MissionStart)
|
||||
oops.gui.removeByNode(this.node)
|
||||
|
||||
@@ -19,7 +19,7 @@ async function login(db, wxContext) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "Failed to get or create user"
|
||||
msg: "获取或创建用户失败"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,13 +38,13 @@ async function login(db, wxContext) {
|
||||
data_version: user.data_version,
|
||||
last_save_time: user.last_save_time || null
|
||||
},
|
||||
msg: "Login successful"
|
||||
msg: "登录成功"
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Login error:", error);
|
||||
console.error("登录错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Login error: ${error.message}`
|
||||
msg: `登录错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -81,13 +81,13 @@ async function getOrCreaterUser(db, openid) {
|
||||
});
|
||||
userData._id = addResult._id;
|
||||
|
||||
console.log(`New user created: ${openid}, version: ${initData.data_version}`);
|
||||
console.log(`新用户已创建: ${openid}, 版本: ${initData.data_version}`);
|
||||
} else {
|
||||
userData = res.data[0];
|
||||
|
||||
// 检查数据版本兼容性
|
||||
const versionCheck = checkDataVersionCompatibility(userData.data_version);
|
||||
console.log(`User ${openid} data version check:`, versionCheck);
|
||||
console.log(`用户 ${openid} 数据版本检查:`, versionCheck);
|
||||
|
||||
if (versionCheck.needsUpgrade) {
|
||||
// 使用新的数据管理系统合并和升级数据
|
||||
@@ -110,13 +110,13 @@ async function getOrCreaterUser(db, openid) {
|
||||
userData.equips = upgradedData.equips;
|
||||
userData.data_version = upgradedData.data_version;
|
||||
|
||||
console.log(`User ${openid} data upgraded to version: ${upgradedData.data_version}`);
|
||||
console.log(`用户 ${openid} 数据已升级到版本: ${upgradedData.data_version}`);
|
||||
}
|
||||
}
|
||||
|
||||
return userData;
|
||||
} catch (err) {
|
||||
console.error(`Get or create user err`, err);
|
||||
console.error(`获取或创建用户错误`, err);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ async function getUserInfo(db, openid) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -147,13 +147,13 @@ async function getUserInfo(db, openid) {
|
||||
data_version: user.data_version,
|
||||
last_save_time: user.last_save_time
|
||||
},
|
||||
msg: "User info retrieved successfully"
|
||||
msg: "用户信息获取成功"
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Get user info error:", error);
|
||||
console.error("获取用户信息错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Get user info error: ${error.message}`
|
||||
msg: `获取用户信息错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ async function checkVersion(db, openid) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -186,13 +186,13 @@ async function checkVersion(db, openid) {
|
||||
regist_time: user.regist_time,
|
||||
last_save_time: user.last_save_time
|
||||
},
|
||||
msg: "Version information retrieved successfully"
|
||||
msg: "版本信息获取成功"
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Check version error:", error);
|
||||
console.error("检查版本错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Check version error: ${error.message}`
|
||||
msg: `检查版本错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -253,19 +253,19 @@ async function upgradeUserData(db, openid) {
|
||||
tals: upgradedData.tals,
|
||||
equips: upgradedData.equips
|
||||
},
|
||||
msg: "Data upgrade completed successfully"
|
||||
msg: "数据升级成功完成"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: -1,
|
||||
msg: `Upgrade fail, ${JSON.stringify(upgradeDataRes)}`
|
||||
msg: `升级失败, ${JSON.stringify(upgradeDataRes)}`
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Upgrade user data error:", error);
|
||||
console.error("升级用户数据错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Upgrade error: ${error.message}`
|
||||
msg: `升级错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,20 +15,20 @@ async function getFightHeros(db, openid) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
code: 200,
|
||||
data: user.fight_heros,
|
||||
msg: "Fight heros retrieved successfully"
|
||||
msg: "出战英雄获取成功"
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Get fight heros error:", error);
|
||||
console.error("获取出战英雄错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Get fight heros error: ${error.message}`
|
||||
msg: `获取出战英雄错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ async function setFightHero(db, openid, position, heroId) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ async function setFightHero(db, openid, position, heroId) {
|
||||
if (position < 0 || position > 4) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Invalid position, must be 0-4"
|
||||
msg: "无效的位置,必须是0-4"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ async function setFightHero(db, openid, position, heroId) {
|
||||
if (typeof heroId !== 'number' || heroId < 0) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Invalid hero ID"
|
||||
msg: "无效的英雄ID"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ async function setFightHero(db, openid, position, heroId) {
|
||||
if (heroId > 0 && !user.heros[heroId]) {
|
||||
return {
|
||||
code: -6,
|
||||
msg: "Hero not owned"
|
||||
msg: "未拥有该英雄"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,19 +93,19 @@ async function setFightHero(db, openid, position, heroId) {
|
||||
old_hero_id: oldHeroId,
|
||||
new_hero_id: heroId
|
||||
},
|
||||
msg: `Fight hero position ${position} updated successfully`
|
||||
msg: `出战英雄位置 ${position} 更新成功`
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: -1,
|
||||
msg: `Set fight hero fail`
|
||||
msg: `设置出战英雄失败`
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Set fight hero error:", error);
|
||||
console.error("设置出战英雄错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Set fight hero error: ${error.message}`
|
||||
msg: `设置出战英雄错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ async function updateFightHeros(db, openid, fightHeros) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ async function updateFightHeros(db, openid, fightHeros) {
|
||||
if (!fightHeros || typeof fightHeros !== 'object') {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Invalid fight heros data format"
|
||||
msg: "无效的出战英雄数据格式"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -144,14 +144,14 @@ async function updateFightHeros(db, openid, fightHeros) {
|
||||
if (isNaN(position) || position < 0 || position > 4) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: `Invalid position: ${pos}`
|
||||
msg: `无效的位置: ${pos}`
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof heroId !== 'number' || heroId < 0) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: `Invalid hero ID for position ${pos}: ${heroId}`
|
||||
msg: `位置 ${pos} 的英雄ID无效: ${heroId}`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ async function updateFightHeros(db, openid, fightHeros) {
|
||||
if (heroId > 0 && !user.heros[heroId]) {
|
||||
return {
|
||||
code: -6,
|
||||
msg: `Hero ${heroId} not owned for position ${pos}`
|
||||
msg: `位置 ${pos} 未拥有英雄 ${heroId}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -177,19 +177,19 @@ async function updateFightHeros(db, openid, fightHeros) {
|
||||
return {
|
||||
code: 200,
|
||||
data: newFightHeros,
|
||||
msg: "Fight heros updated successfully"
|
||||
msg: "出战英雄更新成功"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: -1,
|
||||
msg: `Update fight heros fail`
|
||||
msg: `更新出战英雄失败`
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Update fight heros error:", error);
|
||||
console.error("更新出战英雄错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Update fight heros error: ${error.message}`
|
||||
msg: `更新出战英雄错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ async function getActiveFightHeros(db, openid) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -228,13 +228,13 @@ async function getActiveFightHeros(db, openid) {
|
||||
active_heros: activeHeros,
|
||||
total_count: activeHeros.length
|
||||
},
|
||||
msg: "Active fight heros retrieved successfully"
|
||||
msg: "获取活跃出战英雄成功"
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Get active fight heros error:", error);
|
||||
console.error("获取活跃出战英雄错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Get active fight heros error: ${error.message}`
|
||||
msg: `获取活跃出战英雄错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ async function swapFightHeros(db, openid, position1, position2) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -262,14 +262,14 @@ async function swapFightHeros(db, openid, position1, position2) {
|
||||
if (position1 < 0 || position1 > 4 || position2 < 0 || position2 > 4) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Invalid positions, must be 0-4"
|
||||
msg: "无效的位置,必须是0-4"
|
||||
};
|
||||
}
|
||||
|
||||
if (position1 === position2) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Cannot swap same position"
|
||||
msg: "不能交换相同位置"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -293,19 +293,19 @@ async function swapFightHeros(db, openid, position1, position2) {
|
||||
hero1_moved_to: hero1,
|
||||
hero2_moved_to: hero2
|
||||
},
|
||||
msg: `Fight heros swapped successfully`
|
||||
msg: `出战英雄交换成功`
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: -1,
|
||||
msg: `Swap fight heros fail`
|
||||
msg: `交换出战英雄失败`
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Swap fight heros error:", error);
|
||||
console.error("交换出战英雄错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Swap fight heros error: ${error.message}`
|
||||
msg: `交换出战英雄错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -324,7 +324,7 @@ async function resetFightHeros(db, openid) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -342,19 +342,19 @@ async function resetFightHeros(db, openid) {
|
||||
return {
|
||||
code: 200,
|
||||
data: defaultData.fight_heros,
|
||||
msg: "Fight heros reset successfully"
|
||||
msg: "出战英雄重置成功"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: -1,
|
||||
msg: `Reset fail, ${JSON.stringify(resetRes)}`
|
||||
msg: `重置失败, ${JSON.stringify(resetRes)}`
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Reset fight heros error:", error);
|
||||
console.error("重置出战英雄错误:", error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Reset fight heros error: ${error.message}`
|
||||
msg: `重置出战英雄错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ async function getInventory(db, openid, dataType) {
|
||||
if (!validateDataType(dataType)) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: `Invalid data type: ${dataType}`
|
||||
msg: `无效的数据类型: ${dataType}`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,20 +35,20 @@ async function getInventory(db, openid, dataType) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
code: 200,
|
||||
data: user[dataType],
|
||||
msg: `${dataType} retrieved successfully`
|
||||
msg: `${dataType}获取成功`
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(`Get ${dataType} error:`, error);
|
||||
console.error(`获取${dataType}错误:`, error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Get ${dataType} error: ${error.message}`
|
||||
msg: `获取${dataType}错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ async function getInventoryItem(db, openid, dataType, itemId) {
|
||||
if (!validateDataType(dataType)) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: `Invalid data type: ${dataType}`
|
||||
msg: `无效的数据类型: ${dataType}`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ async function getInventoryItem(db, openid, dataType, itemId) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ async function getInventoryItem(db, openid, dataType, itemId) {
|
||||
if (itemCount === undefined) {
|
||||
return {
|
||||
code: -6,
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} not found`
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} 未找到`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,13 +92,13 @@ async function getInventoryItem(db, openid, dataType, itemId) {
|
||||
item_id: itemId,
|
||||
count: itemCount
|
||||
},
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} retrieved successfully`
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} 获取成功`
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(`Get ${dataType} item error:`, error);
|
||||
console.error(`获取${dataType}物品错误:`, error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Get ${dataType} item error: ${error.message}`
|
||||
msg: `获取${dataType}物品错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ async function addInventoryItem(db, openid, dataType, itemId, count) {
|
||||
if (!validateDataType(dataType)) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: `Invalid data type: ${dataType}`
|
||||
msg: `无效的数据类型: ${dataType}`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -126,14 +126,14 @@ async function addInventoryItem(db, openid, dataType, itemId, count) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof count !== 'number' || count < 0) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Count must be a non-negative number"
|
||||
msg: "数量必须是非负数"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -156,19 +156,19 @@ async function addInventoryItem(db, openid, dataType, itemId, count) {
|
||||
new_count: newCount,
|
||||
added: count
|
||||
},
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} added successfully`
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} 添加成功`
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: -1,
|
||||
msg: `Add ${dataType.slice(0, -1)} fail`
|
||||
msg: `添加 ${dataType.slice(0, -1)} 失败`
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Add ${dataType} item error:`, error);
|
||||
console.error(`添加${dataType}物品错误:`, error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Add ${dataType} item error: ${error.message}`
|
||||
msg: `添加${dataType}物品错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ async function consumeInventoryItem(db, openid, dataType, itemId, count) {
|
||||
if (!validateDataType(dataType)) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: `Invalid data type: ${dataType}`
|
||||
msg: `无效的数据类型: ${dataType}`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -195,14 +195,14 @@ async function consumeInventoryItem(db, openid, dataType, itemId, count) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof count !== 'number' || count < 0) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Count must be a non-negative number"
|
||||
msg: "数量必须是非负数"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -210,16 +210,16 @@ async function consumeInventoryItem(db, openid, dataType, itemId, count) {
|
||||
if (currentCount < count) {
|
||||
return {
|
||||
code: -6,
|
||||
msg: `Insufficient ${dataType.slice(0, -1)} ${itemId}, current: ${currentCount}, required: ${count}`
|
||||
msg: `${dataType.slice(0, -1)} ${itemId}不足, 当前: ${currentCount}, 需要: ${count}`
|
||||
};
|
||||
}
|
||||
|
||||
return await addInventoryItem(db, openid, dataType, itemId, -count);
|
||||
} catch (error) {
|
||||
console.error(`Consume ${dataType} item error:`, error);
|
||||
console.error(`消耗${dataType}物品错误:`, error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Consume ${dataType} item error: ${error.message}`
|
||||
msg: `消耗${dataType}物品错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ async function setInventoryItem(db, openid, dataType, itemId, count) {
|
||||
if (!validateDataType(dataType)) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: `Invalid data type: ${dataType}`
|
||||
msg: `无效的数据类型: ${dataType}`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -247,14 +247,14 @@ async function setInventoryItem(db, openid, dataType, itemId, count) {
|
||||
if (!user) {
|
||||
return {
|
||||
code: -4,
|
||||
msg: "User not found"
|
||||
msg: "未找到用户"
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof count !== 'number' || count < 0) {
|
||||
return {
|
||||
code: -3,
|
||||
msg: "Count must be a non-negative number"
|
||||
msg: "数量必须是非负数"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -275,19 +275,19 @@ async function setInventoryItem(db, openid, dataType, itemId, count) {
|
||||
old_count: oldCount,
|
||||
new_count: count
|
||||
},
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} set successfully`
|
||||
msg: `${dataType.slice(0, -1)} ${itemId} 设置成功`
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: -1,
|
||||
msg: `Set ${dataType.slice(0, -1)} fail`
|
||||
msg: `设置 ${dataType.slice(0, -1)} 失败`
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Set ${dataType} item error:`, error);
|
||||
console.error(`设置${dataType}物品错误:`, error);
|
||||
return {
|
||||
code: -5,
|
||||
msg: `Set ${dataType} item error: ${error.message}`
|
||||
msg: `设置${dataType}物品错误: ${error.message}`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ const { DATA_VERSION } = require('../user_init_data');
|
||||
* @param {Object} extra 额外信息
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function success(data = null, message = "Success", extra = {}) {
|
||||
function success(data = null, message = "成功", extra = {}) {
|
||||
return {
|
||||
code: 200,
|
||||
data: data,
|
||||
@@ -42,7 +42,7 @@ function error(code, message, data = null) {
|
||||
* @param {any} data 错误相关数据
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function badRequest(message = "Bad request", data = null) {
|
||||
function badRequest(message = "请求参数错误", data = null) {
|
||||
return error(-3, message, data);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ function badRequest(message = "Bad request", data = null) {
|
||||
* @param {string} message 错误消息
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function userNotFound(message = "User not found") {
|
||||
function userNotFound(message = "未找到用户") {
|
||||
return error(-4, message);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ function userNotFound(message = "User not found") {
|
||||
* @param {Error} err 错误对象
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function systemError(message = "System error", err = null) {
|
||||
function systemError(message = "系统错误", err = null) {
|
||||
const errorData = err ? {
|
||||
error_message: err.message,
|
||||
error_stack: process.env.NODE_ENV === 'development' ? err.stack : undefined
|
||||
@@ -78,7 +78,7 @@ function systemError(message = "System error", err = null) {
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function insufficientResource(resource, current = 0, required = 0) {
|
||||
return error(-6, `Insufficient ${resource}`, {
|
||||
return error(-6, `${resource}不足`, {
|
||||
resource: resource,
|
||||
current: current,
|
||||
required: required,
|
||||
@@ -93,7 +93,7 @@ function insufficientResource(resource, current = 0, required = 0) {
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function resourceExists(resource, identifier = null) {
|
||||
return error(-7, `${resource} already exists`, {
|
||||
return error(-7, `${resource}已存在`, {
|
||||
resource: resource,
|
||||
identifier: identifier
|
||||
});
|
||||
@@ -106,7 +106,7 @@ function resourceExists(resource, identifier = null) {
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function operationDenied(reason, data = null) {
|
||||
return error(-8, `Operation denied: ${reason}`, data);
|
||||
return error(-8, `操作被拒绝: ${reason}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +116,7 @@ function operationDenied(reason, data = null) {
|
||||
* @returns {Object} 响应对象
|
||||
*/
|
||||
function unknownCommand(command, availableCommands = []) {
|
||||
return error(-2, `Unknown command: ${command}`, {
|
||||
return error(-2, `未知命令: ${command}`, {
|
||||
command: command,
|
||||
available_commands: availableCommands
|
||||
});
|
||||
@@ -139,10 +139,10 @@ function wrapAsync(operation, operationName = "Operation") {
|
||||
}
|
||||
|
||||
// 如果是成功结果,包装为成功响应
|
||||
return success(result, `${operationName} completed successfully`);
|
||||
return success(result, `${operationName}成功完成`);
|
||||
} catch (error) {
|
||||
console.error(`${operationName} error:`, error);
|
||||
return systemError(`${operationName} failed`, error);
|
||||
console.error(`${operationName}错误:`, error);
|
||||
return systemError(`${operationName}失败`, error);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user