From 17f2d64207d41c905b1ecb44652f782a4920ec74 Mon Sep 17 00:00:00 2001 From: xlj <543978819@qq.com> Date: Sun, 21 Sep 2025 20:48:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scenes/MainScene.scene | 431 ++++++++++++------ .../Scripts/chat18x/core/EmotionAIService.ts | 4 +- assets/Scripts/chat18x/utils/ErrorHandler.ts | 4 +- assets/bundles/Chat18x/TipsPanel.prefab | 9 +- 4 files changed, 297 insertions(+), 151 deletions(-) diff --git a/assets/Scenes/MainScene.scene b/assets/Scenes/MainScene.scene index 0cc393a2..db95d973 100644 --- a/assets/Scenes/MainScene.scene +++ b/assets/Scenes/MainScene.scene @@ -23,7 +23,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 73 + "__id__": 77 }, "_lpos": { "__type__": "cc.Vec3", @@ -54,7 +54,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 78 + "__id__": 82 }, "_id": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4" }, @@ -74,22 +74,22 @@ "__id__": 5 }, { - "__id__": 40 + "__id__": 44 } ], "_active": true, "_components": [ { - "__id__": 70 + "__id__": 74 }, { - "__id__": 71 + "__id__": 75 }, { - "__id__": 72 + "__id__": 76 }, { - "__id__": 38 + "__id__": 42 } ], "_prefab": null, @@ -232,22 +232,25 @@ "__id__": 13 }, { - "__id__": 20 + "__id__": 17 }, { - "__id__": 31 + "__id__": 24 + }, + { + "__id__": 35 } ], "_active": true, "_components": [ { - "__id__": 35 + "__id__": 39 }, { - "__id__": 36 + "__id__": 40 }, { - "__id__": 37 + "__id__": 41 } ], "_prefab": null, @@ -379,7 +382,7 @@ }, { "__type__": "cc.Node", - "_name": "text", + "_name": "Sprite", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -399,6 +402,148 @@ } ], "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "85ojBcXeFANoujYBlr56y9" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 9 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2841.9 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "c6KodT0rRP/LHFzW83MFds" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 9 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 153 + }, + "_spriteFrame": { + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "c9yVxock1KWZFMK/5+noKK" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 9 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": -363.45000000000005, + "_bottom": -363.45000000000005, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 40, + "_originalHeight": 36, + "_alignMode": 2, + "_lockFlags": 5, + "_id": "2356hc6HBNAY58EnxFH7bO" + }, + { + "__type__": "cc.Node", + "_name": "text", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 14 + }, + { + "__id__": 15 + }, + { + "__id__": 16 + } + ], + "_prefab": null, "_lpos": { "__type__": "cc.Vec3", "x": 0, @@ -434,7 +579,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 9 + "__id__": 13 }, "_enabled": true, "__prefab": null, @@ -456,7 +601,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 9 + "__id__": 13 }, "_enabled": true, "__prefab": null, @@ -521,7 +666,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 9 + "__id__": 13 }, "_enabled": true, "__prefab": null, @@ -540,19 +685,19 @@ }, "_children": [ { - "__id__": 14 + "__id__": 18 } ], "_active": true, "_components": [ { - "__id__": 17 + "__id__": 21 }, { - "__id__": 18 + "__id__": 22 }, { - "__id__": 19 + "__id__": 23 } ], "_prefab": null, @@ -591,16 +736,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 13 + "__id__": 17 }, "_children": [], "_active": true, "_components": [ { - "__id__": 15 + "__id__": 19 }, { - "__id__": 16 + "__id__": 20 } ], "_prefab": null, @@ -639,7 +784,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 14 + "__id__": 18 }, "_enabled": true, "__prefab": null, @@ -661,7 +806,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 14 + "__id__": 18 }, "_enabled": true, "__prefab": null, @@ -700,7 +845,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 13 + "__id__": 17 }, "_enabled": true, "__prefab": null, @@ -722,7 +867,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 13 + "__id__": 17 }, "_enabled": true, "__prefab": null, @@ -761,7 +906,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 13 + "__id__": 17 }, "_enabled": true, "__prefab": null, @@ -795,16 +940,16 @@ }, "_children": [ { - "__id__": 21 + "__id__": 25 } ], "_active": true, "_components": [ { - "__id__": 29 + "__id__": 33 }, { - "__id__": 30 + "__id__": 34 } ], "_prefab": null, @@ -843,26 +988,26 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 20 + "__id__": 24 }, "_children": [ { - "__id__": 22 + "__id__": 26 } ], "_active": true, "_components": [ { - "__id__": 25 + "__id__": 29 }, { - "__id__": 26 + "__id__": 30 }, { - "__id__": 27 + "__id__": 31 }, { - "__id__": 28 + "__id__": 32 } ], "_prefab": null, @@ -901,16 +1046,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 21 + "__id__": 25 }, "_children": [], "_active": true, "_components": [ { - "__id__": 23 + "__id__": 27 }, { - "__id__": 24 + "__id__": 28 } ], "_prefab": null, @@ -949,7 +1094,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 22 + "__id__": 26 }, "_enabled": true, "__prefab": null, @@ -971,7 +1116,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 22 + "__id__": 26 }, "_enabled": true, "__prefab": null, @@ -1033,7 +1178,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 25 }, "_enabled": true, "__prefab": null, @@ -1055,7 +1200,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 25 }, "_enabled": true, "__prefab": null, @@ -1094,7 +1239,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 25 }, "_enabled": true, "__prefab": null, @@ -1124,7 +1269,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 25 }, "_enabled": true, "__prefab": null, @@ -1166,7 +1311,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 21 + "__id__": 25 }, "_id": "c1YFFV+9dHEKQS7zVcNg9H" }, @@ -1176,7 +1321,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 20 + "__id__": 24 }, "_enabled": true, "__prefab": null, @@ -1198,7 +1343,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 20 + "__id__": 24 }, "_enabled": true, "__prefab": null, @@ -1234,13 +1379,13 @@ "_active": true, "_components": [ { - "__id__": 32 + "__id__": 36 }, { - "__id__": 33 + "__id__": 37 }, { - "__id__": 34 + "__id__": 38 } ], "_prefab": null, @@ -1279,7 +1424,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 31 + "__id__": 35 }, "_enabled": true, "__prefab": null, @@ -1301,7 +1446,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 31 + "__id__": 35 }, "_enabled": true, "__prefab": null, @@ -1363,7 +1508,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 31 + "__id__": 35 }, "_enabled": true, "__prefab": null, @@ -1450,7 +1595,7 @@ "_enabled": true, "__prefab": null, "mainScene": { - "__id__": 38 + "__id__": 42 }, "_id": "81PEyjJPJOvaY0u8iqWtBY" }, @@ -1465,10 +1610,10 @@ "_enabled": true, "__prefab": null, "UIRoot": { - "__id__": 39 + "__id__": 43 }, "UILayerMod": { - "__id__": 50 + "__id__": 54 }, "MainCamera": { "__id__": 4 @@ -1481,16 +1626,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 40 + "__id__": 44 }, "_children": [], "_active": true, "_components": [ { - "__id__": 68 + "__id__": 72 }, { - "__id__": 69 + "__id__": 73 } ], "_prefab": null, @@ -1533,28 +1678,28 @@ }, "_children": [ { - "__id__": 41 + "__id__": 45 }, { - "__id__": 39 + "__id__": 43 }, { - "__id__": 50 + "__id__": 54 }, { - "__id__": 53 + "__id__": 57 }, { - "__id__": 56 + "__id__": 60 } ], "_active": true, "_components": [ { - "__id__": 66 + "__id__": 70 }, { - "__id__": 67 + "__id__": 71 } ], "_prefab": null, @@ -1593,23 +1738,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 40 + "__id__": 44 }, "_children": [ { - "__id__": 42 + "__id__": 46 } ], "_active": true, "_components": [ { - "__id__": 47 + "__id__": 51 }, { - "__id__": 48 + "__id__": 52 }, { - "__id__": 49 + "__id__": 53 } ], "_prefab": null, @@ -1648,19 +1793,19 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 41 + "__id__": 45 }, "_children": [], "_active": true, "_components": [ { - "__id__": 43 + "__id__": 47 }, { - "__id__": 44 + "__id__": 48 }, { - "__id__": 46 + "__id__": 50 } ], "_prefab": null, @@ -1699,7 +1844,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 42 + "__id__": 46 }, "_enabled": true, "__prefab": null, @@ -1721,7 +1866,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 42 + "__id__": 46 }, "_enabled": true, "__prefab": null, @@ -1738,7 +1883,7 @@ "_keepAspectRatio": true, "videoPlayerEvent": [ { - "__id__": 45 + "__id__": 49 } ], "_id": "423wj8SLdJxpHi5bzVZasX" @@ -1746,7 +1891,7 @@ { "__type__": "cc.ClickEvent", "target": { - "__id__": 42 + "__id__": 46 }, "component": "", "_componentId": "72cc36txkdCsYwmehDVnUGe", @@ -1759,7 +1904,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 42 + "__id__": 46 }, "_enabled": true, "__prefab": null, @@ -1771,7 +1916,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 41 + "__id__": 45 }, "_enabled": true, "__prefab": null, @@ -1793,7 +1938,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 41 + "__id__": 45 }, "_enabled": true, "__prefab": null, @@ -1823,7 +1968,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 41 + "__id__": 45 }, "_enabled": true, "__prefab": null, @@ -1836,16 +1981,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 40 + "__id__": 44 }, "_children": [], "_active": true, "_components": [ { - "__id__": 51 + "__id__": 55 }, { - "__id__": 52 + "__id__": 56 } ], "_prefab": null, @@ -1884,7 +2029,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 54 }, "_enabled": true, "__prefab": null, @@ -1906,7 +2051,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 54 }, "_enabled": true, "__prefab": null, @@ -1936,16 +2081,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 40 + "__id__": 44 }, "_children": [], "_active": true, "_components": [ { - "__id__": 54 + "__id__": 58 }, { - "__id__": 55 + "__id__": 59 } ], "_prefab": null, @@ -1984,7 +2129,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 53 + "__id__": 57 }, "_enabled": true, "__prefab": null, @@ -2006,7 +2151,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 53 + "__id__": 57 }, "_enabled": true, "__prefab": null, @@ -2025,17 +2170,17 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 40 + "__id__": 44 }, "_children": [ { - "__id__": 57 + "__id__": 61 } ], "_active": false, "_components": [ { - "__id__": 65 + "__id__": 69 } ], "_prefab": null, @@ -2074,26 +2219,26 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 56 + "__id__": 60 }, "_children": [ { - "__id__": 58 + "__id__": 62 } ], "_active": true, "_components": [ { - "__id__": 61 + "__id__": 65 }, { - "__id__": 62 + "__id__": 66 }, { - "__id__": 63 + "__id__": 67 }, { - "__id__": 64 + "__id__": 68 } ], "_prefab": null, @@ -2132,16 +2277,16 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 57 + "__id__": 61 }, "_children": [], "_active": true, "_components": [ { - "__id__": 59 + "__id__": 63 }, { - "__id__": 60 + "__id__": 64 } ], "_prefab": null, @@ -2180,7 +2325,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 58 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2202,7 +2347,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 58 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2264,7 +2409,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 57 + "__id__": 61 }, "_enabled": true, "__prefab": null, @@ -2286,7 +2431,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 57 + "__id__": 61 }, "_enabled": true, "__prefab": null, @@ -2325,7 +2470,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 57 + "__id__": 61 }, "_enabled": true, "__prefab": null, @@ -2379,7 +2524,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 57 + "__id__": 61 }, "_id": "f22A3TNbFMvbuNfDD/K03a" }, @@ -2389,12 +2534,12 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 57 + "__id__": 61 }, "_enabled": true, "__prefab": null, "startTestButton": { - "__id__": 63 + "__id__": 67 }, "statusLabel": null, "resultLabel": null, @@ -2406,7 +2551,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 56 + "__id__": 60 }, "_enabled": true, "__prefab": null, @@ -2428,7 +2573,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 40 + "__id__": 44 }, "_enabled": true, "__prefab": null, @@ -2450,7 +2595,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 40 + "__id__": 44 }, "_enabled": true, "__prefab": null, @@ -2480,7 +2625,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 39 + "__id__": 43 }, "_enabled": true, "__prefab": null, @@ -2502,7 +2647,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 39 + "__id__": 43 }, "_enabled": true, "__prefab": null, @@ -2602,27 +2747,27 @@ "instance": null, "targetOverrides": [ { - "__id__": 74 + "__id__": 78 }, { - "__id__": 76 + "__id__": 80 } ] }, { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 38 + "__id__": 42 }, "sourceInfo": null, "propertyPath": [ "UIRoot" ], "target": { - "__id__": 40 + "__id__": 44 }, "targetInfo": { - "__id__": 75 + "__id__": 79 } }, { @@ -2634,17 +2779,17 @@ { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 38 + "__id__": 42 }, "sourceInfo": null, "propertyPath": [ "UILayerMod" ], "target": { - "__id__": 40 + "__id__": 44 }, "targetInfo": { - "__id__": 77 + "__id__": 81 } }, { @@ -2656,29 +2801,29 @@ { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 79 - }, - "shadows": { - "__id__": 80 - }, - "_skybox": { - "__id__": 81 - }, - "fog": { - "__id__": 82 - }, - "octree": { "__id__": 83 }, - "skin": { + "shadows": { "__id__": 84 }, - "lightProbeInfo": { + "_skybox": { "__id__": 85 }, - "postSettings": { + "fog": { "__id__": 86 }, + "octree": { + "__id__": 87 + }, + "skin": { + "__id__": 88 + }, + "lightProbeInfo": { + "__id__": 89 + }, + "postSettings": { + "__id__": 90 + }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false }, diff --git a/assets/Scripts/chat18x/core/EmotionAIService.ts b/assets/Scripts/chat18x/core/EmotionAIService.ts index 0b6a9648..e4942155 100644 --- a/assets/Scripts/chat18x/core/EmotionAIService.ts +++ b/assets/Scripts/chat18x/core/EmotionAIService.ts @@ -49,7 +49,7 @@ export class EmotionAIService { error as Error, ErrorType.API_ERROR, { config: { ...emotionConfig, apiKey: "***" } }, // 隐藏API密钥 - true + false ); throw error; } @@ -217,7 +217,7 @@ export class EmotionAIService { new Error(warningMsg), ErrorType.API_ERROR, { roleId, message, response }, - true + false ); return null; } diff --git a/assets/Scripts/chat18x/utils/ErrorHandler.ts b/assets/Scripts/chat18x/utils/ErrorHandler.ts index 54f78a9b..c685ce32 100644 --- a/assets/Scripts/chat18x/utils/ErrorHandler.ts +++ b/assets/Scripts/chat18x/utils/ErrorHandler.ts @@ -102,10 +102,10 @@ export class ErrorHandler { requestData, responseError: error, }; - if (error.status == "FAILED_PRECONDITION") { + if (details.responseError.message.includes("FAILED_PRECONDITION")) { //当前用户区域不支持聊天功能 TipsPanel.show(LanguageUtils.getText("chat_error_code_2003")); - } else if (error.message.includes("Fetch is aborted")) { + } else if (error.message.includes("aborted")) { TipsPanel.show(LanguageUtils.getText("chat_error_code_2004")); } else { this.handleError( diff --git a/assets/bundles/Chat18x/TipsPanel.prefab b/assets/bundles/Chat18x/TipsPanel.prefab index f5424c95..bf6a127b 100644 --- a/assets/bundles/Chat18x/TipsPanel.prefab +++ b/assets/bundles/Chat18x/TipsPanel.prefab @@ -486,8 +486,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 807.6796875, - "height": 50.4 + "width": 1009.279688, + "height": 112.7 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -525,11 +525,11 @@ "_string": "Insufficient balance, need to purchase", "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 48, + "_actualFontSize": 49, "_fontSize": 48, "_fontFamily": "Arial", "_lineHeight": 40, - "_overflow": 0, + "_overflow": 2, "_enableWrapText": true, "_font": null, "_isSystemFontUsed": true, @@ -673,6 +673,7 @@ "__id__": 0 }, "fileId": "630e3mesJKuZJC9gpYcm7p", + "instance": null, "targetOverrides": null } ] \ No newline at end of file