init
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "fd2dcbe2-8804-4651-bec8-e5371fb4f9ea",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "fd2dcbe2-8804-4651-bec8-e5371fb4f9ea@6c48a",
|
||||
"displayName": "nanamiya_rie_avatar",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "fd2dcbe2-8804-4651-bec8-e5371fb4f9ea",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "fd2dcbe2-8804-4651-bec8-e5371fb4f9ea@f9941",
|
||||
"displayName": "nanamiya_rie_avatar",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 80,
|
||||
"height": 80,
|
||||
"rawWidth": 80,
|
||||
"rawHeight": 80,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-40,
|
||||
-40,
|
||||
0,
|
||||
40,
|
||||
-40,
|
||||
0,
|
||||
-40,
|
||||
40,
|
||||
0,
|
||||
40,
|
||||
40,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
80,
|
||||
80,
|
||||
80,
|
||||
0,
|
||||
0,
|
||||
80,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-40,
|
||||
-40,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
40,
|
||||
40,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "fd2dcbe2-8804-4651-bec8-e5371fb4f9ea@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "fd2dcbe2-8804-4651-bec8-e5371fb4f9ea@6c48a"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 590 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "fbe8d145-9766-489c-a565-8a476a0f82d2",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "fbe8d145-9766-489c-a565-8a476a0f82d2@6c48a",
|
||||
"displayName": "phecda_default",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "fbe8d145-9766-489c-a565-8a476a0f82d2",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "fbe8d145-9766-489c-a565-8a476a0f82d2@f9941",
|
||||
"displayName": "phecda_default",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": -5,
|
||||
"trimX": 0,
|
||||
"trimY": 10,
|
||||
"width": 925,
|
||||
"height": 1179,
|
||||
"rawWidth": 925,
|
||||
"rawHeight": 1189,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-462.5,
|
||||
-589.5,
|
||||
0,
|
||||
462.5,
|
||||
-589.5,
|
||||
0,
|
||||
-462.5,
|
||||
589.5,
|
||||
0,
|
||||
462.5,
|
||||
589.5,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
1179,
|
||||
925,
|
||||
1179,
|
||||
0,
|
||||
0,
|
||||
925,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0.9915895710681245,
|
||||
1,
|
||||
0.9915895710681245
|
||||
],
|
||||
"minPos": [
|
||||
-462.5,
|
||||
-589.5,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
462.5,
|
||||
589.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "fbe8d145-9766-489c-a565-8a476a0f82d2@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "fbe8d145-9766-489c-a565-8a476a0f82d2@6c48a"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 407 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 152 KiB |
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "5b59484b-3611-41a2-865e-d52795950b85",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "5b59484b-3611-41a2-865e-d52795950b85@6c48a",
|
||||
"displayName": "login1",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "5b59484b-3611-41a2-865e-d52795950b85",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "5b59484b-3611-41a2-865e-d52795950b85@f9941",
|
||||
"displayName": "login1",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 1,
|
||||
"width": 400,
|
||||
"height": 98,
|
||||
"rawWidth": 400,
|
||||
"rawHeight": 100,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-200,
|
||||
-49,
|
||||
0,
|
||||
200,
|
||||
-49,
|
||||
0,
|
||||
-200,
|
||||
49,
|
||||
0,
|
||||
200,
|
||||
49,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
99,
|
||||
400,
|
||||
99,
|
||||
0,
|
||||
1,
|
||||
400,
|
||||
1
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0.01,
|
||||
1,
|
||||
0.01,
|
||||
0,
|
||||
0.99,
|
||||
1,
|
||||
0.99
|
||||
],
|
||||
"minPos": [
|
||||
-200,
|
||||
-49,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
200,
|
||||
49,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "5b59484b-3611-41a2-865e-d52795950b85@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "5b59484b-3611-41a2-865e-d52795950b85@6c48a"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "5b5852f7-2556-489e-a2bc-d333cef3395a",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "5b5852f7-2556-489e-a2bc-d333cef3395a@6c48a",
|
||||
"displayName": "tarenaya_shy",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "5b5852f7-2556-489e-a2bc-d333cef3395a",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "5b5852f7-2556-489e-a2bc-d333cef3395a@f9941",
|
||||
"displayName": "tarenaya_shy",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 50.5,
|
||||
"offsetY": -72,
|
||||
"trimX": 105,
|
||||
"trimY": 144,
|
||||
"width": 816,
|
||||
"height": 1045,
|
||||
"rawWidth": 925,
|
||||
"rawHeight": 1189,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-408,
|
||||
-522.5,
|
||||
0,
|
||||
408,
|
||||
-522.5,
|
||||
0,
|
||||
-408,
|
||||
522.5,
|
||||
0,
|
||||
408,
|
||||
522.5,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
105,
|
||||
1045,
|
||||
921,
|
||||
1045,
|
||||
105,
|
||||
0,
|
||||
921,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0.11351351351351352,
|
||||
0,
|
||||
0.9956756756756757,
|
||||
0,
|
||||
0.11351351351351352,
|
||||
0.8788898233809924,
|
||||
0.9956756756756757,
|
||||
0.8788898233809924
|
||||
],
|
||||
"minPos": [
|
||||
-408,
|
||||
-522.5,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
408,
|
||||
522.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "5b5852f7-2556-489e-a2bc-d333cef3395a@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "5b5852f7-2556-489e-a2bc-d333cef3395a@6c48a"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "c095bc3b-41c7-487f-ab4d-3de5f939cf76",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "c095bc3b-41c7-487f-ab4d-3de5f939cf76@6c48a",
|
||||
"displayName": "shirley_laugh",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "c095bc3b-41c7-487f-ab4d-3de5f939cf76",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "c095bc3b-41c7-487f-ab4d-3de5f939cf76@f9941",
|
||||
"displayName": "shirley_laugh",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "none",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 925,
|
||||
"height": 1189,
|
||||
"rawWidth": 925,
|
||||
"rawHeight": 1189,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-462.5,
|
||||
-594.5,
|
||||
0,
|
||||
462.5,
|
||||
-594.5,
|
||||
0,
|
||||
-462.5,
|
||||
594.5,
|
||||
0,
|
||||
462.5,
|
||||
594.5,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
1189,
|
||||
925,
|
||||
1189,
|
||||
0,
|
||||
0,
|
||||
925,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-462.5,
|
||||
-594.5,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
462.5,
|
||||
594.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "c095bc3b-41c7-487f-ab4d-3de5f939cf76@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "c095bc3b-41c7-487f-ab4d-3de5f939cf76@6c48a"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
import { _decorator, Node, v2 } from "cc";
|
||||
import { I_LevelConfig, I_LevelStepData, I_NpcTalkBack, I_TalkRecordInfo } from "../Config/CommonConfig";
|
||||
import SocketUnit from "../Common/SocketUnit";
|
||||
import Utils from "../Common/Utils";
|
||||
import { InnerMsgCode } from "../Config/InnerMsgCode";
|
||||
import SubManager from "../../Sub/SubManager";
|
||||
import HttpUnit from "../Common/HttpUnit";
|
||||
import { SDKManager } from "../Channel/SDKManager";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
/**聊天状态 */
|
||||
export enum E_TalkStatusType {
|
||||
succ = 0, //成功
|
||||
talking = 1, //对话中
|
||||
fail = 2, //失败
|
||||
noCount = 3, //次数不足
|
||||
}
|
||||
|
||||
|
||||
/**对话阶段 */
|
||||
export enum E_TalkStage {
|
||||
/**开场白 */
|
||||
prologue,
|
||||
/**我的对话 */
|
||||
myTalk,
|
||||
/**等待NPC回复 */
|
||||
waitNpcTalk,
|
||||
/**NPC对话 */
|
||||
npcTalk,
|
||||
/**NPC固定话术 */
|
||||
npcFixedTalk,
|
||||
/**更新对话状态 */
|
||||
upTalkStatus,
|
||||
}
|
||||
|
||||
|
||||
//游戏管理器
|
||||
@ccclass('GameManager')
|
||||
export default class GameManager {
|
||||
|
||||
private static _I: GameManager = null;
|
||||
public static get I(): GameManager {
|
||||
if (!GameManager._I) {
|
||||
GameManager._I = new GameManager();
|
||||
GameManager._I.init();
|
||||
}
|
||||
return GameManager._I;
|
||||
}
|
||||
|
||||
private init(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
//region长连接相关
|
||||
private _socket: SocketUnit = null;
|
||||
/**连接长连接 */
|
||||
public connetSorcket(record_id:string){
|
||||
this.disconnectSocket();
|
||||
this._socket = new SocketUnit();
|
||||
// this._socket.connect(`ws://47.119.190.199:20190/game/ai/response/${record_id}`);
|
||||
this._socket.connect(`wss://www.confessioncontract.com/game/ai/response/${record_id}`);
|
||||
this._socket.onDataReceived((data: any) => {
|
||||
let resData = JSON.parse(data.data)
|
||||
if (GameManager.curStage != E_TalkStage.waitNpcTalk) return
|
||||
if (resData.isFinished) {
|
||||
console.log("npc回复:", resData)
|
||||
GameManager.CurNpcTalkData = resData
|
||||
Utils.sendInnerMsg(InnerMsgCode.Data_NpcTalkBack, resData || {})
|
||||
}
|
||||
})
|
||||
}
|
||||
/**断开长连接 */
|
||||
public disconnectSocket(){
|
||||
if (this._socket){
|
||||
this._socket.disconnect();
|
||||
}
|
||||
this._socket = null;
|
||||
}
|
||||
/**获取npc回复 */
|
||||
public getNpcTalkBack(data: any){
|
||||
if (this._socket){
|
||||
let str = JSON.stringify(data)
|
||||
this._socket.sendData(str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//region关卡配置
|
||||
private static _levelCfgArray: I_LevelConfig[] = [];
|
||||
private static _levelCfgMap: {[key: string]: I_LevelConfig} = {};
|
||||
/**设置关卡配置数据 */
|
||||
public static SetLevelCfg(levelCfg: any[]) {
|
||||
GameManager._levelCfgArray = levelCfg;
|
||||
let info:any = null;
|
||||
let umRecords = [] //友盟解锁关卡记录
|
||||
let recordLvs = HttpUnit.GetLevelRecord(); //友盟已记录的关卡
|
||||
for (let i = 0; i < levelCfg.length; i++) {
|
||||
info = levelCfg[i];
|
||||
GameManager._levelCfgMap[info.id] = info;
|
||||
//判断是否已记录
|
||||
if (info.is_unlock) {
|
||||
if (recordLvs.indexOf(info.id) == -1){
|
||||
umRecords.push(info.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
//友盟记录关卡
|
||||
if (umRecords.length > 0 && SDKManager.umaSwt()){
|
||||
let umr = umRecords.join(',')
|
||||
HttpUnit.ins.sendLevelRecord({level_ids:umr}, (_data)=>{
|
||||
console.log('友盟记录关卡',_data)
|
||||
let userId = HttpUnit.GetID()
|
||||
let curDate = Utils.GetNowFormatDay()
|
||||
for (let i = 0; i < umRecords.length; i++) {
|
||||
let lvId = umRecords[i]
|
||||
let _cfg = GameManager._levelCfgMap[lvId]
|
||||
SDKManager.umaEvent(SDKManager.Uma_Event_LvUnlock, {
|
||||
lvId: lvId,
|
||||
userId: userId,
|
||||
time: curDate,
|
||||
type: _cfg.unlock_type
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
/**设置关卡星级 */
|
||||
public static SetLevelStar(levelId: string, star: number) {
|
||||
let cfg = GameManager._levelCfgMap[levelId];
|
||||
if (cfg) {
|
||||
cfg.star = star;
|
||||
}
|
||||
}
|
||||
|
||||
/**获取关卡配置 */
|
||||
public static getLevelCfg(levelId: string): I_LevelConfig {
|
||||
return GameManager._levelCfgMap[levelId];
|
||||
}
|
||||
|
||||
/**获取npc表情图片 */
|
||||
public static GetNpcEmoPic(emoStr: string): string {
|
||||
let path = ""
|
||||
let lvCfg = GameManager.getLevelCfg(GameManager.CurLevelId);
|
||||
if (emoStr == "害羞") {
|
||||
path = `emo_1/${lvCfg.characterShyPortrait}`
|
||||
} else if (emoStr == "开心") {
|
||||
path = `emo_2/${lvCfg.characterHappyPortrait}`
|
||||
} else if (emoStr == "厌恶") {
|
||||
path = `emo_3/${lvCfg.characterHatePortrait}`
|
||||
} else {
|
||||
path = `role/${lvCfg.characterFullLengthPortrait}` //默认
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
//regionAI语音开关
|
||||
private static _AIVoiceSwt: boolean = false;
|
||||
/**设置是否显示AI语音 */
|
||||
public static set AIVoiceSwt(value: boolean) {
|
||||
GameManager._AIVoiceSwt = value;
|
||||
}
|
||||
/**获取是否显示AI语音 */
|
||||
public static get AIVoiceSwt(): boolean {
|
||||
return GameManager._AIVoiceSwt;
|
||||
}
|
||||
|
||||
|
||||
//region当前关卡ID
|
||||
private static _curLevelId: string = "";
|
||||
/**设置当前关卡ID */
|
||||
public static set CurLevelId(value: string) {
|
||||
GameManager._curLevelId = value;
|
||||
}
|
||||
/**获取当前关卡ID */
|
||||
public static get CurLevelId(): string {
|
||||
return GameManager._curLevelId;
|
||||
}
|
||||
|
||||
|
||||
//region流程id
|
||||
private static _recordId: string = "";
|
||||
/**设置当前关卡流程ID */
|
||||
public static set RecordId(value: string) {
|
||||
GameManager._recordId = value;
|
||||
}
|
||||
/**获取当前关卡流程ID */
|
||||
public static get RecordId(): string {
|
||||
return GameManager._recordId;
|
||||
}
|
||||
|
||||
|
||||
//region当前步骤数据
|
||||
private static _curLevelData: I_LevelStepData = null;
|
||||
/**设置当前步骤数据 */
|
||||
public static set CurLevelData(value: I_LevelStepData) {
|
||||
GameManager._curLevelData = value;
|
||||
}
|
||||
/**获取当前步骤数据 */
|
||||
public static get CurLevelData(): I_LevelStepData {
|
||||
return GameManager._curLevelData;
|
||||
}
|
||||
|
||||
|
||||
//region NPC回复数据
|
||||
private static _curNpcTalkData: I_NpcTalkBack = null;
|
||||
/**设置当前NPC回复数据 */
|
||||
public static set CurNpcTalkData(value: I_NpcTalkBack) {
|
||||
GameManager._curNpcTalkData = value;
|
||||
}
|
||||
/**获取当前NPC回复数据 */
|
||||
public static get CurNpcTalkData(): I_NpcTalkBack {
|
||||
return GameManager._curNpcTalkData;
|
||||
}
|
||||
|
||||
|
||||
//region 当前NPC话术文本
|
||||
private static _curNpcFixedTalkText: string = "";
|
||||
/**设置当前NPC话术文本 */
|
||||
public static set CurNpcFixedTalkText(value: string) {
|
||||
GameManager._curNpcFixedTalkText = value;
|
||||
}
|
||||
/**获取当前NPC话术文本 */
|
||||
public static get CurNpcFixedTalkText(): string {
|
||||
return GameManager._curNpcFixedTalkText;
|
||||
}
|
||||
|
||||
|
||||
//region关卡步骤评分
|
||||
private static stepScoreList: number[] = [];
|
||||
/**设置关卡步骤评分 */
|
||||
public static AddStepScore(score: number) {
|
||||
GameManager.stepScoreList.push(score);
|
||||
}
|
||||
/**清空关卡步骤评分 */
|
||||
public static ClearStepScore() {
|
||||
GameManager.stepScoreList = [];
|
||||
}
|
||||
/**获取最新得分 */
|
||||
public static getCurStepScore(): number {
|
||||
if (GameManager.stepScoreList.length == 0) return 0;
|
||||
return GameManager.stepScoreList[GameManager.stepScoreList.length - 1];
|
||||
}
|
||||
/**获取关卡当前评分
|
||||
* @returns [总分,平均分]
|
||||
*/
|
||||
public static getGameScore(): [number,number] {
|
||||
let totalScore = 0;
|
||||
let totalStep = 0;
|
||||
GameManager.stepScoreList.forEach((score) => {
|
||||
totalScore += score;
|
||||
totalStep++;
|
||||
})
|
||||
let scoreRate = totalStep > 0 ? Math.floor(totalScore / totalStep) : 0;
|
||||
return [totalScore, scoreRate];
|
||||
}
|
||||
|
||||
|
||||
//region对话记录
|
||||
private static talkRecordList: I_TalkRecordInfo[] = [];
|
||||
/**添加对话记录 */
|
||||
public static AddTalkRecord(record: I_TalkRecordInfo) {
|
||||
GameManager.talkRecordList.push(record);
|
||||
}
|
||||
/**移除最后一条对话记录 */
|
||||
public static RemoveLastRoundTalkRecord() {
|
||||
let cellLen = GameManager.talkRecordList.length;
|
||||
if (cellLen > 1) {
|
||||
for (let i=cellLen-1; i>=0; i--) {
|
||||
let talkAry = GameManager.talkRecordList.splice(i, 1)
|
||||
if (talkAry[0] && talkAry[0].isMe) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**清空对话记录 */
|
||||
public static ClearTalkRecord() {
|
||||
GameManager.talkRecordList = [];
|
||||
}
|
||||
/**获取对话记录 */
|
||||
public static get TalkRecordList(): I_TalkRecordInfo[] {
|
||||
return GameManager.talkRecordList;
|
||||
}
|
||||
|
||||
|
||||
//region 当前对话阶段
|
||||
private static _curStage: E_TalkStage = E_TalkStage.prologue;
|
||||
/**获取当前对话阶段 */
|
||||
public static get curStage(): E_TalkStage {
|
||||
return GameManager._curStage;
|
||||
}
|
||||
/**设置当前对话阶段 */
|
||||
public static TurnToStage(value: E_TalkStage, force: boolean = false) {
|
||||
if (GameManager._curStage == value && !force) return;
|
||||
GameManager._curStage = value;
|
||||
Utils.sendInnerMsg(InnerMsgCode.UI_TalkStageUp, {})
|
||||
}
|
||||
|
||||
|
||||
//region 已用对话轮次
|
||||
private static _srouceCnt: number = 0;
|
||||
/**获取已用对话轮次 */
|
||||
public static get srouceCnt(): number {
|
||||
return GameManager._srouceCnt;
|
||||
}
|
||||
/**设置已用对话轮次 */
|
||||
public static set srouceCnt(value: number) {
|
||||
GameManager._srouceCnt = value;
|
||||
}
|
||||
|
||||
//region 心动次数
|
||||
private static _xindongCishu: number = 0;
|
||||
/**获取心动次数 */
|
||||
public static get xindongCishu(): number {
|
||||
return GameManager._xindongCishu;
|
||||
}
|
||||
/**设置心动次数 */
|
||||
public static set xindongCishu(value: number) {
|
||||
GameManager._xindongCishu = value;
|
||||
}
|
||||
|
||||
//region npc固定话术喜欢次数
|
||||
private static _npcFixTalkCountXihuan: number = 0;
|
||||
/**获取npc固定话术喜欢次数 */
|
||||
public static get npcFixTalkCountXihuan(): number {
|
||||
return GameManager._npcFixTalkCountXihuan;
|
||||
}
|
||||
/**设置npc固定话术喜欢次数 */
|
||||
public static set npcFixTalkCountXihuan(value: number) {
|
||||
GameManager._npcFixTalkCountXihuan = value;
|
||||
}
|
||||
|
||||
//region npc固定话术讨厌次数
|
||||
private static _npcFixTalkCountTaoyan: number = 0;
|
||||
/**获取npc固定话术讨厌次数 */
|
||||
public static get npcFixTalkCountTaoyan(): number {
|
||||
return GameManager._npcFixTalkCountTaoyan;
|
||||
}
|
||||
/**设置npc固定话术讨厌次数 */
|
||||
public static set npcFixTalkCountTaoyan(value: number) {
|
||||
GameManager._npcFixTalkCountTaoyan = value;
|
||||
}
|
||||
|
||||
|
||||
//region 结束关卡
|
||||
/**结束关卡 */
|
||||
public static EndGame() {
|
||||
GameManager.I.disconnectSocket();
|
||||
GameManager.ClearStepScore()
|
||||
GameManager.ClearTalkRecord()
|
||||
GameManager.CurLevelId = ""
|
||||
GameManager.RecordId = ""
|
||||
GameManager.CurLevelData = null
|
||||
GameManager.CurNpcTalkData = null
|
||||
GameManager.srouceCnt = 0
|
||||
GameManager.xindongCishu = 0
|
||||
GameManager.npcFixTalkCountXihuan = 0
|
||||
GameManager.npcFixTalkCountTaoyan = 0
|
||||
GameManager._curStage = E_TalkStage.prologue
|
||||
}
|
||||
|
||||
|
||||
//region 重新开始关卡
|
||||
/**重新开始关卡 */
|
||||
public static RestartGame() {
|
||||
if (GameManager.CurLevelId == "") {
|
||||
return
|
||||
}
|
||||
GameManager._restartGameStep1()
|
||||
}
|
||||
//重开步骤1 刷新用户数据
|
||||
private static _restartGameStep1() {
|
||||
HttpUnit.ins.getUserData((userData) => {
|
||||
GameManager._restartGameStep2()
|
||||
})
|
||||
}
|
||||
//重开步骤2 刷新关卡数据
|
||||
private static _restartGameStep2() {
|
||||
HttpUnit.ins.getLevelList((levelList) => {
|
||||
if (levelList) {
|
||||
GameManager.SetLevelCfg(levelList)
|
||||
GameManager._restartGameStep3()
|
||||
}
|
||||
})
|
||||
}
|
||||
//重开步骤3 判断条件
|
||||
private static _restartGameStep3() {
|
||||
if (HttpUnit.GetXiangqinTickets() <= 0) {
|
||||
SubManager.ShowPrompt("今日相亲次数已用完");
|
||||
return;
|
||||
}
|
||||
let level_id = GameManager.CurLevelId
|
||||
HttpUnit.ins.levelStart({level_id:level_id}, (data) => {
|
||||
GameManager.EndGame()
|
||||
GameManager.CurLevelId = level_id
|
||||
GameManager.CurLevelData = data.level
|
||||
GameManager.RecordId = data.record_id
|
||||
GameManager.I.connetSorcket(data.record_id) //连接socket
|
||||
Utils.sendInnerMsg(InnerMsgCode.UI_ResartGame, {})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
static checkLevelRecord() {
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 316 KiB |
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"__version__": "1.3.8",
|
||||
"log": {
|
||||
"level": 4
|
||||
},
|
||||
"common": {
|
||||
"polyfills": {
|
||||
"asyncFunctions": true
|
||||
},
|
||||
"buildPath": "project://build",
|
||||
"outputName": "web-mobile",
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"platform": "web-mobile",
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.0",
|
||||
"nativeCodeBundleMode": "asmjs",
|
||||
"md5Cache": true
|
||||
},
|
||||
"BuildTaskManager": {
|
||||
"taskMap": {
|
||||
"1736231456475": {
|
||||
"type": "build",
|
||||
"id": "1736231456475",
|
||||
"progress": 1,
|
||||
"state": "success",
|
||||
"stage": "build",
|
||||
"message": "2025-1-11 11:21:12 build success in 13 s!",
|
||||
"detailMessage": "// ---- build task cocos-service:onAfterBuild ----\r",
|
||||
"options": {
|
||||
"name": "_Empty2D",
|
||||
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.0",
|
||||
"platform": "wechatgame",
|
||||
"buildPath": "project://build",
|
||||
"debug": false,
|
||||
"md5Cache": true,
|
||||
"skipCompressTexture": false,
|
||||
"sourceMaps": false,
|
||||
"overwriteProjectSettings": {
|
||||
"macroConfig": {
|
||||
"cleanupImageCache": "on"
|
||||
},
|
||||
"includeModules": {
|
||||
"physics": "inherit-project-setting",
|
||||
"physics-2d": "inherit-project-setting",
|
||||
"gfx-webgl2": "off"
|
||||
}
|
||||
},
|
||||
"nativeCodeBundleMode": "asmjs",
|
||||
"polyfills": {
|
||||
"asyncFunctions": false
|
||||
},
|
||||
"experimentalEraseModules": false,
|
||||
"startSceneAssetBundle": false,
|
||||
"bundleConfigs": [],
|
||||
"useBuiltinServer": false,
|
||||
"md5CacheOptions": {
|
||||
"excludes": [],
|
||||
"includes": [],
|
||||
"replaceOnly": [],
|
||||
"handleTemplateMd5Link": true
|
||||
},
|
||||
"mainBundleIsRemote": false,
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"useSplashScreen": true,
|
||||
"bundleCommonChunk": false,
|
||||
"packAutoAtlas": true,
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"outputName": "wechatgame",
|
||||
"taskName": "wechatgame",
|
||||
"scenes": [
|
||||
{
|
||||
"url": "db://assets/Scenes/MainScene.scene",
|
||||
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
|
||||
},
|
||||
{
|
||||
"url": "db://assets/Scenes/PreloadScene.scene",
|
||||
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
|
||||
}
|
||||
],
|
||||
"wasmCompressionMode": false,
|
||||
"packages": {},
|
||||
"__version__": "1.3.8",
|
||||
"logDest": "project://temp/builder/log/wechatgame2025-1-7 14-30.log"
|
||||
},
|
||||
"time": "2025-1-11 11:20:58",
|
||||
"dirty": false
|
||||
},
|
||||
"1736573831185": {
|
||||
"type": "build",
|
||||
"id": "1736573831185",
|
||||
"progress": 1,
|
||||
"state": "success",
|
||||
"stage": "build",
|
||||
"message": "2025-1-13 17:06:31 build success in 12 s!",
|
||||
"detailMessage": "// ---- build task cocos-service:onAfterBuild ----\r",
|
||||
"options": {
|
||||
"name": "XiangQin",
|
||||
"server": "",
|
||||
"platform": "web-mobile",
|
||||
"buildPath": "project://build",
|
||||
"debug": false,
|
||||
"md5Cache": false,
|
||||
"skipCompressTexture": false,
|
||||
"sourceMaps": false,
|
||||
"overwriteProjectSettings": {
|
||||
"includeModules": {
|
||||
"gfx-webgl2": "on",
|
||||
"physics": "inherit-project-setting",
|
||||
"physics-2d": "inherit-project-setting"
|
||||
},
|
||||
"macroConfig": {
|
||||
"cleanupImageCache": "inherit-project-setting"
|
||||
}
|
||||
},
|
||||
"nativeCodeBundleMode": "both",
|
||||
"polyfills": {
|
||||
"asyncFunctions": true
|
||||
},
|
||||
"experimentalEraseModules": false,
|
||||
"startSceneAssetBundle": false,
|
||||
"bundleConfigs": [],
|
||||
"useBuiltinServer": false,
|
||||
"md5CacheOptions": {
|
||||
"excludes": [],
|
||||
"includes": [],
|
||||
"replaceOnly": [],
|
||||
"handleTemplateMd5Link": true
|
||||
},
|
||||
"mainBundleIsRemote": false,
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"useSplashScreen": true,
|
||||
"bundleCommonChunk": false,
|
||||
"packAutoAtlas": true,
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"outputName": "web-mobile",
|
||||
"taskName": "web-mobile",
|
||||
"scenes": [
|
||||
{
|
||||
"url": "db://assets/Scenes/MainScene.scene",
|
||||
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
|
||||
},
|
||||
{
|
||||
"url": "db://assets/Scenes/PreloadScene.scene",
|
||||
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
|
||||
}
|
||||
],
|
||||
"wasmCompressionMode": false,
|
||||
"packages": {},
|
||||
"__version__": "1.3.8",
|
||||
"buildMode": "normal",
|
||||
"logDest": "project://temp/builder/log/web-mobile2025-1-11 13-37.log"
|
||||
},
|
||||
"time": "2025-1-13 17:06:19",
|
||||
"dirty": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "cd3ed81b-5049-47e4-92fe-294af1c029e1",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user