i
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "8c67bc3f-c771-4a2a-aed9-f5a8a27f237d",
|
"uuid": "8c67bc3f-c771-4a2a-aed9-f5a8a27f237d",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,134 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.0.26",
|
"ver": "1.0.26",
|
||||||
"importer": "image",
|
"importer": "image",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3",
|
"uuid": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3",
|
||||||
"files": [
|
"files": [
|
||||||
".json",
|
".json",
|
||||||
".png"
|
".png"
|
||||||
],
|
],
|
||||||
"subMetas": {
|
"subMetas": {
|
||||||
"6c48a": {
|
"6c48a": {
|
||||||
"importer": "texture",
|
"importer": "texture",
|
||||||
"uuid": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@6c48a",
|
"uuid": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@6c48a",
|
||||||
"displayName": "btnclose",
|
"displayName": "btnclose",
|
||||||
"id": "6c48a",
|
"id": "6c48a",
|
||||||
"name": "texture",
|
"name": "texture",
|
||||||
"userData": {
|
"userData": {
|
||||||
"minfilter": "linear",
|
"minfilter": "linear",
|
||||||
"magfilter": "linear",
|
"magfilter": "linear",
|
||||||
"wrapModeT": "clamp-to-edge",
|
"wrapModeT": "clamp-to-edge",
|
||||||
"wrapModeS": "clamp-to-edge",
|
"wrapModeS": "clamp-to-edge",
|
||||||
"mipfilter": "none",
|
"mipfilter": "none",
|
||||||
"imageUuidOrDatabaseUri": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3",
|
"imageUuidOrDatabaseUri": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3",
|
||||||
"anisotropy": 0,
|
"anisotropy": 0,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"ver": "1.0.22",
|
"ver": "1.0.22",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
},
|
},
|
||||||
"f9941": {
|
"f9941": {
|
||||||
"importer": "sprite-frame",
|
"importer": "sprite-frame",
|
||||||
"uuid": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@f9941",
|
"uuid": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@f9941",
|
||||||
"displayName": "btnclose",
|
"displayName": "btnclose",
|
||||||
"id": "f9941",
|
"id": "f9941",
|
||||||
"name": "spriteFrame",
|
"name": "spriteFrame",
|
||||||
"userData": {
|
"userData": {
|
||||||
"trimType": "auto",
|
"trimType": "auto",
|
||||||
"trimThreshold": 1,
|
"trimThreshold": 1,
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"offsetX": 0,
|
"offsetX": 0,
|
||||||
"offsetY": 0,
|
"offsetY": 0,
|
||||||
"trimX": 0,
|
"trimX": 0,
|
||||||
"trimY": 0,
|
"trimY": 0,
|
||||||
"width": 57,
|
"width": 57,
|
||||||
"height": 57,
|
"height": 57,
|
||||||
"rawWidth": 57,
|
"rawWidth": 57,
|
||||||
"rawHeight": 57,
|
"rawHeight": 57,
|
||||||
"borderTop": 0,
|
"borderTop": 0,
|
||||||
"borderBottom": 0,
|
"borderBottom": 0,
|
||||||
"borderLeft": 0,
|
"borderLeft": 0,
|
||||||
"borderRight": 0,
|
"borderRight": 0,
|
||||||
"imageUuidOrDatabaseUri": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@6c48a",
|
"imageUuidOrDatabaseUri": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@6c48a",
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"atlasUuid": "",
|
"atlasUuid": "",
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
"pivotY": 0.5,
|
"pivotY": 0.5,
|
||||||
"meshType": 0,
|
"meshType": 0,
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"rawPosition": [
|
"rawPosition": [
|
||||||
-28.5,
|
-28.5,
|
||||||
-28.5,
|
-28.5,
|
||||||
0,
|
0,
|
||||||
28.5,
|
28.5,
|
||||||
-28.5,
|
-28.5,
|
||||||
0,
|
0,
|
||||||
-28.5,
|
-28.5,
|
||||||
28.5,
|
28.5,
|
||||||
0,
|
0,
|
||||||
28.5,
|
28.5,
|
||||||
28.5,
|
28.5,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"indexes": [
|
"indexes": [
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
57,
|
57,
|
||||||
57,
|
57,
|
||||||
57,
|
57,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
57,
|
57,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"nuv": [
|
"nuv": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"minPos": [
|
"minPos": [
|
||||||
-28.5,
|
-28.5,
|
||||||
-28.5,
|
-28.5,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"maxPos": [
|
"maxPos": [
|
||||||
28.5,
|
28.5,
|
||||||
28.5,
|
28.5,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ver": "1.0.12",
|
"ver": "1.0.12",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"userData": {
|
"userData": {
|
||||||
"type": "sprite-frame",
|
"type": "sprite-frame",
|
||||||
"hasAlpha": true,
|
"hasAlpha": true,
|
||||||
"redirect": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@f9941",
|
"redirect": "6505b0fe-fec0-403f-8cfb-7d06a1b66db3@f9941",
|
||||||
"fixAlphaTransparencyArtifacts": false
|
"fixAlphaTransparencyArtifacts": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,134 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.0.26",
|
"ver": "1.0.26",
|
||||||
"importer": "image",
|
"importer": "image",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "4f24361b-88e7-43c8-9824-9b4e1ff3224d",
|
"uuid": "4f24361b-88e7-43c8-9824-9b4e1ff3224d",
|
||||||
"files": [
|
"files": [
|
||||||
".json",
|
".json",
|
||||||
".png"
|
".png"
|
||||||
],
|
],
|
||||||
"subMetas": {
|
"subMetas": {
|
||||||
"6c48a": {
|
"6c48a": {
|
||||||
"importer": "texture",
|
"importer": "texture",
|
||||||
"uuid": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@6c48a",
|
"uuid": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@6c48a",
|
||||||
"displayName": "loadingicon",
|
"displayName": "loadingicon",
|
||||||
"id": "6c48a",
|
"id": "6c48a",
|
||||||
"name": "texture",
|
"name": "texture",
|
||||||
"userData": {
|
"userData": {
|
||||||
"minfilter": "linear",
|
"minfilter": "linear",
|
||||||
"magfilter": "linear",
|
"magfilter": "linear",
|
||||||
"wrapModeT": "clamp-to-edge",
|
"wrapModeT": "clamp-to-edge",
|
||||||
"wrapModeS": "clamp-to-edge",
|
"wrapModeS": "clamp-to-edge",
|
||||||
"mipfilter": "none",
|
"mipfilter": "none",
|
||||||
"imageUuidOrDatabaseUri": "4f24361b-88e7-43c8-9824-9b4e1ff3224d",
|
"imageUuidOrDatabaseUri": "4f24361b-88e7-43c8-9824-9b4e1ff3224d",
|
||||||
"anisotropy": 0,
|
"anisotropy": 0,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"ver": "1.0.22",
|
"ver": "1.0.22",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
},
|
},
|
||||||
"f9941": {
|
"f9941": {
|
||||||
"importer": "sprite-frame",
|
"importer": "sprite-frame",
|
||||||
"uuid": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@f9941",
|
"uuid": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@f9941",
|
||||||
"displayName": "loadingicon",
|
"displayName": "loadingicon",
|
||||||
"id": "f9941",
|
"id": "f9941",
|
||||||
"name": "spriteFrame",
|
"name": "spriteFrame",
|
||||||
"userData": {
|
"userData": {
|
||||||
"trimType": "auto",
|
"trimType": "auto",
|
||||||
"trimThreshold": 1,
|
"trimThreshold": 1,
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"offsetX": 0,
|
"offsetX": 0,
|
||||||
"offsetY": 1.5,
|
"offsetY": 1.5,
|
||||||
"trimX": 59,
|
"trimX": 59,
|
||||||
"trimY": 58,
|
"trimY": 58,
|
||||||
"width": 242,
|
"width": 242,
|
||||||
"height": 241,
|
"height": 241,
|
||||||
"rawWidth": 360,
|
"rawWidth": 360,
|
||||||
"rawHeight": 360,
|
"rawHeight": 360,
|
||||||
"borderTop": 0,
|
"borderTop": 0,
|
||||||
"borderBottom": 0,
|
"borderBottom": 0,
|
||||||
"borderLeft": 0,
|
"borderLeft": 0,
|
||||||
"borderRight": 0,
|
"borderRight": 0,
|
||||||
"imageUuidOrDatabaseUri": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@6c48a",
|
"imageUuidOrDatabaseUri": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@6c48a",
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"atlasUuid": "",
|
"atlasUuid": "",
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
"pivotY": 0.5,
|
"pivotY": 0.5,
|
||||||
"meshType": 0,
|
"meshType": 0,
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"rawPosition": [
|
"rawPosition": [
|
||||||
-121,
|
-121,
|
||||||
-120.5,
|
-120.5,
|
||||||
0,
|
0,
|
||||||
121,
|
121,
|
||||||
-120.5,
|
-120.5,
|
||||||
0,
|
0,
|
||||||
-121,
|
-121,
|
||||||
120.5,
|
120.5,
|
||||||
0,
|
0,
|
||||||
121,
|
121,
|
||||||
120.5,
|
120.5,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"indexes": [
|
"indexes": [
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"uv": [
|
"uv": [
|
||||||
59,
|
59,
|
||||||
302,
|
302,
|
||||||
301,
|
301,
|
||||||
302,
|
302,
|
||||||
59,
|
59,
|
||||||
61,
|
61,
|
||||||
301,
|
301,
|
||||||
61
|
61
|
||||||
],
|
],
|
||||||
"nuv": [
|
"nuv": [
|
||||||
0.1638888888888889,
|
0.1638888888888889,
|
||||||
0.16944444444444445,
|
0.16944444444444445,
|
||||||
0.8361111111111111,
|
0.8361111111111111,
|
||||||
0.16944444444444445,
|
0.16944444444444445,
|
||||||
0.1638888888888889,
|
0.1638888888888889,
|
||||||
0.8388888888888889,
|
0.8388888888888889,
|
||||||
0.8361111111111111,
|
0.8361111111111111,
|
||||||
0.8388888888888889
|
0.8388888888888889
|
||||||
],
|
],
|
||||||
"minPos": [
|
"minPos": [
|
||||||
-121,
|
-121,
|
||||||
-120.5,
|
-120.5,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"maxPos": [
|
"maxPos": [
|
||||||
121,
|
121,
|
||||||
120.5,
|
120.5,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ver": "1.0.12",
|
"ver": "1.0.12",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"userData": {
|
"userData": {
|
||||||
"type": "sprite-frame",
|
"type": "sprite-frame",
|
||||||
"hasAlpha": true,
|
"hasAlpha": true,
|
||||||
"redirect": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@f9941",
|
"redirect": "4f24361b-88e7-43c8-9824-9b4e1ff3224d@f9941",
|
||||||
"fixAlphaTransparencyArtifacts": false
|
"fixAlphaTransparencyArtifacts": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,134 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.0.26",
|
"ver": "1.0.26",
|
||||||
"importer": "image",
|
"importer": "image",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "2873a640-2652-44bc-9cf2-e74e7499dbf1",
|
"uuid": "2873a640-2652-44bc-9cf2-e74e7499dbf1",
|
||||||
"files": [
|
"files": [
|
||||||
".json",
|
".json",
|
||||||
".png"
|
".png"
|
||||||
],
|
],
|
||||||
"subMetas": {
|
"subMetas": {
|
||||||
"6c48a": {
|
"6c48a": {
|
||||||
"importer": "texture",
|
"importer": "texture",
|
||||||
"uuid": "2873a640-2652-44bc-9cf2-e74e7499dbf1@6c48a",
|
"uuid": "2873a640-2652-44bc-9cf2-e74e7499dbf1@6c48a",
|
||||||
"displayName": "progressbar",
|
"displayName": "progressbar",
|
||||||
"id": "6c48a",
|
"id": "6c48a",
|
||||||
"name": "texture",
|
"name": "texture",
|
||||||
"userData": {
|
"userData": {
|
||||||
"minfilter": "linear",
|
"minfilter": "linear",
|
||||||
"magfilter": "linear",
|
"magfilter": "linear",
|
||||||
"wrapModeT": "clamp-to-edge",
|
"wrapModeT": "clamp-to-edge",
|
||||||
"wrapModeS": "clamp-to-edge",
|
"wrapModeS": "clamp-to-edge",
|
||||||
"mipfilter": "none",
|
"mipfilter": "none",
|
||||||
"imageUuidOrDatabaseUri": "2873a640-2652-44bc-9cf2-e74e7499dbf1",
|
"imageUuidOrDatabaseUri": "2873a640-2652-44bc-9cf2-e74e7499dbf1",
|
||||||
"anisotropy": 0,
|
"anisotropy": 0,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"ver": "1.0.22",
|
"ver": "1.0.22",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
},
|
},
|
||||||
"f9941": {
|
"f9941": {
|
||||||
"importer": "sprite-frame",
|
"importer": "sprite-frame",
|
||||||
"uuid": "2873a640-2652-44bc-9cf2-e74e7499dbf1@f9941",
|
"uuid": "2873a640-2652-44bc-9cf2-e74e7499dbf1@f9941",
|
||||||
"displayName": "progressbar",
|
"displayName": "progressbar",
|
||||||
"id": "f9941",
|
"id": "f9941",
|
||||||
"name": "spriteFrame",
|
"name": "spriteFrame",
|
||||||
"userData": {
|
"userData": {
|
||||||
"trimType": "auto",
|
"trimType": "auto",
|
||||||
"trimThreshold": 1,
|
"trimThreshold": 1,
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"offsetX": 0,
|
"offsetX": 0,
|
||||||
"offsetY": 0,
|
"offsetY": 0,
|
||||||
"trimX": 3,
|
"trimX": 3,
|
||||||
"trimY": 2,
|
"trimY": 2,
|
||||||
"width": 850,
|
"width": 850,
|
||||||
"height": 20,
|
"height": 20,
|
||||||
"rawWidth": 856,
|
"rawWidth": 856,
|
||||||
"rawHeight": 24,
|
"rawHeight": 24,
|
||||||
"borderTop": 0,
|
"borderTop": 0,
|
||||||
"borderBottom": 0,
|
"borderBottom": 0,
|
||||||
"borderLeft": 22,
|
"borderLeft": 22,
|
||||||
"borderRight": 36,
|
"borderRight": 36,
|
||||||
"imageUuidOrDatabaseUri": "2873a640-2652-44bc-9cf2-e74e7499dbf1@6c48a",
|
"imageUuidOrDatabaseUri": "2873a640-2652-44bc-9cf2-e74e7499dbf1@6c48a",
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"atlasUuid": "",
|
"atlasUuid": "",
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
"pivotY": 0.5,
|
"pivotY": 0.5,
|
||||||
"meshType": 0,
|
"meshType": 0,
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"rawPosition": [
|
"rawPosition": [
|
||||||
-425,
|
-425,
|
||||||
-10,
|
-10,
|
||||||
0,
|
0,
|
||||||
425,
|
425,
|
||||||
-10,
|
-10,
|
||||||
0,
|
0,
|
||||||
-425,
|
-425,
|
||||||
10,
|
10,
|
||||||
0,
|
0,
|
||||||
425,
|
425,
|
||||||
10,
|
10,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"indexes": [
|
"indexes": [
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"uv": [
|
"uv": [
|
||||||
3,
|
3,
|
||||||
22,
|
22,
|
||||||
853,
|
853,
|
||||||
22,
|
22,
|
||||||
3,
|
3,
|
||||||
2,
|
2,
|
||||||
853,
|
853,
|
||||||
2
|
2
|
||||||
],
|
],
|
||||||
"nuv": [
|
"nuv": [
|
||||||
0.0035046728971962616,
|
0.0035046728971962616,
|
||||||
0.08333333333333333,
|
0.08333333333333333,
|
||||||
0.9964953271028038,
|
0.9964953271028038,
|
||||||
0.08333333333333333,
|
0.08333333333333333,
|
||||||
0.0035046728971962616,
|
0.0035046728971962616,
|
||||||
0.9166666666666666,
|
0.9166666666666666,
|
||||||
0.9964953271028038,
|
0.9964953271028038,
|
||||||
0.9166666666666666
|
0.9166666666666666
|
||||||
],
|
],
|
||||||
"minPos": [
|
"minPos": [
|
||||||
-425,
|
-425,
|
||||||
-10,
|
-10,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"maxPos": [
|
"maxPos": [
|
||||||
425,
|
425,
|
||||||
10,
|
10,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ver": "1.0.12",
|
"ver": "1.0.12",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"userData": {
|
"userData": {
|
||||||
"type": "sprite-frame",
|
"type": "sprite-frame",
|
||||||
"hasAlpha": true,
|
"hasAlpha": true,
|
||||||
"redirect": "2873a640-2652-44bc-9cf2-e74e7499dbf1@f9941",
|
"redirect": "2873a640-2652-44bc-9cf2-e74e7499dbf1@f9941",
|
||||||
"fixAlphaTransparencyArtifacts": false
|
"fixAlphaTransparencyArtifacts": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,134 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.0.26",
|
"ver": "1.0.26",
|
||||||
"importer": "image",
|
"importer": "image",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "74d83879-8162-4333-b05a-9773f866baf7",
|
"uuid": "74d83879-8162-4333-b05a-9773f866baf7",
|
||||||
"files": [
|
"files": [
|
||||||
".json",
|
".json",
|
||||||
".png"
|
".png"
|
||||||
],
|
],
|
||||||
"subMetas": {
|
"subMetas": {
|
||||||
"6c48a": {
|
"6c48a": {
|
||||||
"importer": "texture",
|
"importer": "texture",
|
||||||
"uuid": "74d83879-8162-4333-b05a-9773f866baf7@6c48a",
|
"uuid": "74d83879-8162-4333-b05a-9773f866baf7@6c48a",
|
||||||
"displayName": "progressbg",
|
"displayName": "progressbg",
|
||||||
"id": "6c48a",
|
"id": "6c48a",
|
||||||
"name": "texture",
|
"name": "texture",
|
||||||
"userData": {
|
"userData": {
|
||||||
"minfilter": "linear",
|
"minfilter": "linear",
|
||||||
"magfilter": "linear",
|
"magfilter": "linear",
|
||||||
"wrapModeT": "clamp-to-edge",
|
"wrapModeT": "clamp-to-edge",
|
||||||
"wrapModeS": "clamp-to-edge",
|
"wrapModeS": "clamp-to-edge",
|
||||||
"mipfilter": "none",
|
"mipfilter": "none",
|
||||||
"imageUuidOrDatabaseUri": "74d83879-8162-4333-b05a-9773f866baf7",
|
"imageUuidOrDatabaseUri": "74d83879-8162-4333-b05a-9773f866baf7",
|
||||||
"anisotropy": 0,
|
"anisotropy": 0,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"ver": "1.0.22",
|
"ver": "1.0.22",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
},
|
},
|
||||||
"f9941": {
|
"f9941": {
|
||||||
"importer": "sprite-frame",
|
"importer": "sprite-frame",
|
||||||
"uuid": "74d83879-8162-4333-b05a-9773f866baf7@f9941",
|
"uuid": "74d83879-8162-4333-b05a-9773f866baf7@f9941",
|
||||||
"displayName": "progressbg",
|
"displayName": "progressbg",
|
||||||
"id": "f9941",
|
"id": "f9941",
|
||||||
"name": "spriteFrame",
|
"name": "spriteFrame",
|
||||||
"userData": {
|
"userData": {
|
||||||
"trimType": "auto",
|
"trimType": "auto",
|
||||||
"trimThreshold": 1,
|
"trimThreshold": 1,
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"offsetX": 0,
|
"offsetX": 0,
|
||||||
"offsetY": 0,
|
"offsetY": 0,
|
||||||
"trimX": 0,
|
"trimX": 0,
|
||||||
"trimY": 0,
|
"trimY": 0,
|
||||||
"width": 856,
|
"width": 856,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"rawWidth": 856,
|
"rawWidth": 856,
|
||||||
"rawHeight": 24,
|
"rawHeight": 24,
|
||||||
"borderTop": 0,
|
"borderTop": 0,
|
||||||
"borderBottom": 0,
|
"borderBottom": 0,
|
||||||
"borderLeft": 31,
|
"borderLeft": 31,
|
||||||
"borderRight": 28,
|
"borderRight": 28,
|
||||||
"imageUuidOrDatabaseUri": "74d83879-8162-4333-b05a-9773f866baf7@6c48a",
|
"imageUuidOrDatabaseUri": "74d83879-8162-4333-b05a-9773f866baf7@6c48a",
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"atlasUuid": "",
|
"atlasUuid": "",
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
"pivotY": 0.5,
|
"pivotY": 0.5,
|
||||||
"meshType": 0,
|
"meshType": 0,
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"rawPosition": [
|
"rawPosition": [
|
||||||
-428,
|
-428,
|
||||||
-12,
|
-12,
|
||||||
0,
|
0,
|
||||||
428,
|
428,
|
||||||
-12,
|
-12,
|
||||||
0,
|
0,
|
||||||
-428,
|
-428,
|
||||||
12,
|
12,
|
||||||
0,
|
0,
|
||||||
428,
|
428,
|
||||||
12,
|
12,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"indexes": [
|
"indexes": [
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
24,
|
24,
|
||||||
856,
|
856,
|
||||||
24,
|
24,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
856,
|
856,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"nuv": [
|
"nuv": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"minPos": [
|
"minPos": [
|
||||||
-428,
|
-428,
|
||||||
-12,
|
-12,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"maxPos": [
|
"maxPos": [
|
||||||
428,
|
428,
|
||||||
12,
|
12,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ver": "1.0.12",
|
"ver": "1.0.12",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"userData": {
|
"userData": {
|
||||||
"type": "sprite-frame",
|
"type": "sprite-frame",
|
||||||
"hasAlpha": true,
|
"hasAlpha": true,
|
||||||
"redirect": "74d83879-8162-4333-b05a-9773f866baf7@f9941",
|
"redirect": "74d83879-8162-4333-b05a-9773f866baf7@f9941",
|
||||||
"fixAlphaTransparencyArtifacts": false
|
"fixAlphaTransparencyArtifacts": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,134 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.0.26",
|
"ver": "1.0.26",
|
||||||
"importer": "image",
|
"importer": "image",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "3832782c-3213-48e7-954d-7a4faba8c748",
|
"uuid": "3832782c-3213-48e7-954d-7a4faba8c748",
|
||||||
"files": [
|
"files": [
|
||||||
".json",
|
".json",
|
||||||
".png"
|
".png"
|
||||||
],
|
],
|
||||||
"subMetas": {
|
"subMetas": {
|
||||||
"6c48a": {
|
"6c48a": {
|
||||||
"importer": "texture",
|
"importer": "texture",
|
||||||
"uuid": "3832782c-3213-48e7-954d-7a4faba8c748@6c48a",
|
"uuid": "3832782c-3213-48e7-954d-7a4faba8c748@6c48a",
|
||||||
"displayName": "tipsbg",
|
"displayName": "tipsbg",
|
||||||
"id": "6c48a",
|
"id": "6c48a",
|
||||||
"name": "texture",
|
"name": "texture",
|
||||||
"userData": {
|
"userData": {
|
||||||
"minfilter": "linear",
|
"minfilter": "linear",
|
||||||
"magfilter": "linear",
|
"magfilter": "linear",
|
||||||
"wrapModeT": "clamp-to-edge",
|
"wrapModeT": "clamp-to-edge",
|
||||||
"wrapModeS": "clamp-to-edge",
|
"wrapModeS": "clamp-to-edge",
|
||||||
"mipfilter": "none",
|
"mipfilter": "none",
|
||||||
"imageUuidOrDatabaseUri": "3832782c-3213-48e7-954d-7a4faba8c748",
|
"imageUuidOrDatabaseUri": "3832782c-3213-48e7-954d-7a4faba8c748",
|
||||||
"anisotropy": 0,
|
"anisotropy": 0,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"ver": "1.0.22",
|
"ver": "1.0.22",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
},
|
},
|
||||||
"f9941": {
|
"f9941": {
|
||||||
"importer": "sprite-frame",
|
"importer": "sprite-frame",
|
||||||
"uuid": "3832782c-3213-48e7-954d-7a4faba8c748@f9941",
|
"uuid": "3832782c-3213-48e7-954d-7a4faba8c748@f9941",
|
||||||
"displayName": "tipsbg",
|
"displayName": "tipsbg",
|
||||||
"id": "f9941",
|
"id": "f9941",
|
||||||
"name": "spriteFrame",
|
"name": "spriteFrame",
|
||||||
"userData": {
|
"userData": {
|
||||||
"trimType": "auto",
|
"trimType": "auto",
|
||||||
"trimThreshold": 1,
|
"trimThreshold": 1,
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"offsetX": 0,
|
"offsetX": 0,
|
||||||
"offsetY": 0,
|
"offsetY": 0,
|
||||||
"trimX": 16,
|
"trimX": 16,
|
||||||
"trimY": 1,
|
"trimY": 1,
|
||||||
"width": 68,
|
"width": 68,
|
||||||
"height": 18,
|
"height": 18,
|
||||||
"rawWidth": 100,
|
"rawWidth": 100,
|
||||||
"rawHeight": 20,
|
"rawHeight": 20,
|
||||||
"borderTop": 0,
|
"borderTop": 0,
|
||||||
"borderBottom": 0,
|
"borderBottom": 0,
|
||||||
"borderLeft": 0,
|
"borderLeft": 0,
|
||||||
"borderRight": 0,
|
"borderRight": 0,
|
||||||
"imageUuidOrDatabaseUri": "3832782c-3213-48e7-954d-7a4faba8c748@6c48a",
|
"imageUuidOrDatabaseUri": "3832782c-3213-48e7-954d-7a4faba8c748@6c48a",
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"atlasUuid": "",
|
"atlasUuid": "",
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
"pivotY": 0.5,
|
"pivotY": 0.5,
|
||||||
"meshType": 0,
|
"meshType": 0,
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"rawPosition": [
|
"rawPosition": [
|
||||||
-34,
|
-34,
|
||||||
-9,
|
-9,
|
||||||
0,
|
0,
|
||||||
34,
|
34,
|
||||||
-9,
|
-9,
|
||||||
0,
|
0,
|
||||||
-34,
|
-34,
|
||||||
9,
|
9,
|
||||||
0,
|
0,
|
||||||
34,
|
34,
|
||||||
9,
|
9,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"indexes": [
|
"indexes": [
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"uv": [
|
"uv": [
|
||||||
16,
|
16,
|
||||||
19,
|
19,
|
||||||
84,
|
84,
|
||||||
19,
|
19,
|
||||||
16,
|
16,
|
||||||
1,
|
1,
|
||||||
84,
|
84,
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"nuv": [
|
"nuv": [
|
||||||
0.16,
|
0.16,
|
||||||
0.05,
|
0.05,
|
||||||
0.84,
|
0.84,
|
||||||
0.05,
|
0.05,
|
||||||
0.16,
|
0.16,
|
||||||
0.95,
|
0.95,
|
||||||
0.84,
|
0.84,
|
||||||
0.95
|
0.95
|
||||||
],
|
],
|
||||||
"minPos": [
|
"minPos": [
|
||||||
-34,
|
-34,
|
||||||
-9,
|
-9,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"maxPos": [
|
"maxPos": [
|
||||||
34,
|
34,
|
||||||
9,
|
9,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ver": "1.0.12",
|
"ver": "1.0.12",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"userData": {
|
"userData": {
|
||||||
"type": "sprite-frame",
|
"type": "sprite-frame",
|
||||||
"hasAlpha": true,
|
"hasAlpha": true,
|
||||||
"redirect": "3832782c-3213-48e7-954d-7a4faba8c748@f9941",
|
"redirect": "3832782c-3213-48e7-954d-7a4faba8c748@f9941",
|
||||||
"fixAlphaTransparencyArtifacts": false
|
"fixAlphaTransparencyArtifacts": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,134 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.0.26",
|
"ver": "1.0.26",
|
||||||
"importer": "image",
|
"importer": "image",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "d6d8e25e-7ddd-482c-b801-9c96b777c200",
|
"uuid": "d6d8e25e-7ddd-482c-b801-9c96b777c200",
|
||||||
"files": [
|
"files": [
|
||||||
".json",
|
".json",
|
||||||
".png"
|
".png"
|
||||||
],
|
],
|
||||||
"subMetas": {
|
"subMetas": {
|
||||||
"6c48a": {
|
"6c48a": {
|
||||||
"importer": "texture",
|
"importer": "texture",
|
||||||
"uuid": "d6d8e25e-7ddd-482c-b801-9c96b777c200@6c48a",
|
"uuid": "d6d8e25e-7ddd-482c-b801-9c96b777c200@6c48a",
|
||||||
"displayName": "weihutips",
|
"displayName": "weihutips",
|
||||||
"id": "6c48a",
|
"id": "6c48a",
|
||||||
"name": "texture",
|
"name": "texture",
|
||||||
"userData": {
|
"userData": {
|
||||||
"minfilter": "linear",
|
"minfilter": "linear",
|
||||||
"magfilter": "linear",
|
"magfilter": "linear",
|
||||||
"wrapModeT": "clamp-to-edge",
|
"wrapModeT": "clamp-to-edge",
|
||||||
"wrapModeS": "clamp-to-edge",
|
"wrapModeS": "clamp-to-edge",
|
||||||
"mipfilter": "none",
|
"mipfilter": "none",
|
||||||
"imageUuidOrDatabaseUri": "d6d8e25e-7ddd-482c-b801-9c96b777c200",
|
"imageUuidOrDatabaseUri": "d6d8e25e-7ddd-482c-b801-9c96b777c200",
|
||||||
"anisotropy": 0,
|
"anisotropy": 0,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
"ver": "1.0.22",
|
"ver": "1.0.22",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
},
|
},
|
||||||
"f9941": {
|
"f9941": {
|
||||||
"importer": "sprite-frame",
|
"importer": "sprite-frame",
|
||||||
"uuid": "d6d8e25e-7ddd-482c-b801-9c96b777c200@f9941",
|
"uuid": "d6d8e25e-7ddd-482c-b801-9c96b777c200@f9941",
|
||||||
"displayName": "weihutips",
|
"displayName": "weihutips",
|
||||||
"id": "f9941",
|
"id": "f9941",
|
||||||
"name": "spriteFrame",
|
"name": "spriteFrame",
|
||||||
"userData": {
|
"userData": {
|
||||||
"trimType": "auto",
|
"trimType": "auto",
|
||||||
"trimThreshold": 1,
|
"trimThreshold": 1,
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"offsetX": 0,
|
"offsetX": 0,
|
||||||
"offsetY": 0,
|
"offsetY": 0,
|
||||||
"trimX": 0,
|
"trimX": 0,
|
||||||
"trimY": 0,
|
"trimY": 0,
|
||||||
"width": 52,
|
"width": 52,
|
||||||
"height": 52,
|
"height": 52,
|
||||||
"rawWidth": 52,
|
"rawWidth": 52,
|
||||||
"rawHeight": 52,
|
"rawHeight": 52,
|
||||||
"borderTop": 24,
|
"borderTop": 24,
|
||||||
"borderBottom": 24,
|
"borderBottom": 24,
|
||||||
"borderLeft": 24,
|
"borderLeft": 24,
|
||||||
"borderRight": 24,
|
"borderRight": 24,
|
||||||
"imageUuidOrDatabaseUri": "d6d8e25e-7ddd-482c-b801-9c96b777c200@6c48a",
|
"imageUuidOrDatabaseUri": "d6d8e25e-7ddd-482c-b801-9c96b777c200@6c48a",
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"isUuid": true,
|
"isUuid": true,
|
||||||
"atlasUuid": "",
|
"atlasUuid": "",
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
"pivotY": 0.5,
|
"pivotY": 0.5,
|
||||||
"meshType": 0,
|
"meshType": 0,
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"rawPosition": [
|
"rawPosition": [
|
||||||
-26,
|
-26,
|
||||||
-26,
|
-26,
|
||||||
0,
|
0,
|
||||||
26,
|
26,
|
||||||
-26,
|
-26,
|
||||||
0,
|
0,
|
||||||
-26,
|
-26,
|
||||||
26,
|
26,
|
||||||
0,
|
0,
|
||||||
26,
|
26,
|
||||||
26,
|
26,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"indexes": [
|
"indexes": [
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
2,
|
2,
|
||||||
1,
|
1,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
52,
|
52,
|
||||||
52,
|
52,
|
||||||
52,
|
52,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
52,
|
52,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"nuv": [
|
"nuv": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"minPos": [
|
"minPos": [
|
||||||
-26,
|
-26,
|
||||||
-26,
|
-26,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"maxPos": [
|
"maxPos": [
|
||||||
26,
|
26,
|
||||||
26,
|
26,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ver": "1.0.12",
|
"ver": "1.0.12",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {}
|
"subMetas": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"userData": {
|
"userData": {
|
||||||
"type": "sprite-frame",
|
"type": "sprite-frame",
|
||||||
"hasAlpha": true,
|
"hasAlpha": true,
|
||||||
"redirect": "d6d8e25e-7ddd-482c-b801-9c96b777c200@f9941",
|
"redirect": "d6d8e25e-7ddd-482c-b801-9c96b777c200@f9941",
|
||||||
"fixAlphaTransparencyArtifacts": false
|
"fixAlphaTransparencyArtifacts": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "70b910ca-b87d-4278-9655-44e7d8081ece",
|
"uuid": "70b910ca-b87d-4278-9655-44e7d8081ece",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.1.50",
|
"ver": "1.1.50",
|
||||||
"importer": "prefab",
|
"importer": "prefab",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "dab2a5cf-b505-4ac7-9513-7b512b9450bf",
|
"uuid": "dab2a5cf-b505-4ac7-9513-7b512b9450bf",
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"syncNodeName": "ProgressPrefab"
|
"syncNodeName": "ProgressPrefab"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "c8a17a26-1000-4175-ba1a-4e73204b652c",
|
"uuid": "c8a17a26-1000-4175-ba1a-4e73204b652c",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "4b615b43-bedb-4b3b-9958-8939a4d446d1",
|
"uuid": "4b615b43-bedb-4b3b-9958-8939a4d446d1",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.1.50",
|
"ver": "1.1.50",
|
||||||
"importer": "prefab",
|
"importer": "prefab",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "2fdbeee9-cb7d-44ab-9ce7-f73b19d0f4fc",
|
"uuid": "2fdbeee9-cb7d-44ab-9ce7-f73b19d0f4fc",
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"syncNodeName": "FishWikiItem"
|
"syncNodeName": "FishWikiItem"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "90f06d6d-eb00-41cc-8c68-7e27d67312c5",
|
"uuid": "90f06d6d-eb00-41cc-8c68-7e27d67312c5",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,363 +1,363 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"__type__": "cc.Prefab",
|
"__type__": "cc.Prefab",
|
||||||
"_name": "ScorePrefab",
|
"_name": "ScorePrefab",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"_native": "",
|
"_native": "",
|
||||||
"data": {
|
"data": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"optimizationPolicy": 0,
|
"optimizationPolicy": 0,
|
||||||
"asyncLoadAssets": false,
|
"asyncLoadAssets": false,
|
||||||
"readonly": false,
|
"readonly": false,
|
||||||
"persistent": false
|
"persistent": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.Node",
|
"__type__": "cc.Node",
|
||||||
"_name": "ScorePrefab",
|
"_name": "ScorePrefab",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"_parent": null,
|
"_parent": null,
|
||||||
"_children": [
|
"_children": [
|
||||||
{
|
{
|
||||||
"__id__": 2
|
"__id__": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 14
|
"__id__": 14
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 16
|
"__id__": 16
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 18
|
"__id__": 18
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 20
|
"__id__": 20
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
"__type__": "cc.Quat",
|
"__type__": "cc.Quat",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0,
|
"z": 0,
|
||||||
"w": 1
|
"w": 1
|
||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 1,
|
"x": 1,
|
||||||
"y": 1,
|
"y": 1,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_layer": 1,
|
"_layer": 1,
|
||||||
"_euler": {
|
"_euler": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_skewX": 0,
|
"_skewX": 0,
|
||||||
"_skewY": 0,
|
"_skewY": 0,
|
||||||
"_is3DNode": false,
|
"_is3DNode": false,
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.Node",
|
"__type__": "cc.Node",
|
||||||
"_name": "txtScore",
|
"_name": "txtScore",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"_parent": {
|
"_parent": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"_children": [],
|
"_children": [],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 3
|
"__id__": 3
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 5
|
"__id__": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 7
|
"__id__": 7
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 9
|
"__id__": 9
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 11
|
"__id__": 11
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 13
|
"__id__": 13
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
"__type__": "cc.Quat",
|
"__type__": "cc.Quat",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0,
|
"z": 0,
|
||||||
"w": 1
|
"w": 1
|
||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 1,
|
"x": 1,
|
||||||
"y": 1,
|
"y": 1,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_layer": 1,
|
"_layer": 1,
|
||||||
"_euler": {
|
"_euler": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_skewX": 0,
|
"_skewX": 0,
|
||||||
"_skewY": 0,
|
"_skewY": 0,
|
||||||
"_is3DNode": false,
|
"_is3DNode": false,
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.Label",
|
"__type__": "cc.Label",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 2
|
"__id__": 2
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 4
|
"__id__": 4
|
||||||
},
|
},
|
||||||
"_customMaterial": {
|
"_customMaterial": {
|
||||||
"__uuid__": "fda095cb-831d-4601-ad94-846013963de8"
|
"__uuid__": "fda095cb-831d-4601-ad94-846013963de8"
|
||||||
},
|
},
|
||||||
"_visFlags": 0,
|
"_visFlags": 0,
|
||||||
"_srcBlendFactor": 2,
|
"_srcBlendFactor": 2,
|
||||||
"_dstBlendFactor": 4,
|
"_dstBlendFactor": 4,
|
||||||
"_color": {
|
"_color": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
"r": 255,
|
"r": 255,
|
||||||
"g": 82,
|
"g": 82,
|
||||||
"b": 0,
|
"b": 0,
|
||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_useOriginalSize": false,
|
"_useOriginalSize": false,
|
||||||
"_string": "100",
|
"_string": "100",
|
||||||
"_horizontalAlign": 1,
|
"_horizontalAlign": 1,
|
||||||
"_verticalAlign": 1,
|
"_verticalAlign": 1,
|
||||||
"_actualFontSize": 0,
|
"_actualFontSize": 0,
|
||||||
"_fontSize": 40,
|
"_fontSize": 40,
|
||||||
"_fontFamily": "Arial",
|
"_fontFamily": "Arial",
|
||||||
"_lineHeight": 40,
|
"_lineHeight": 40,
|
||||||
"_overflow": 0,
|
"_overflow": 0,
|
||||||
"_enableWrapText": true,
|
"_enableWrapText": true,
|
||||||
"_font": null,
|
"_font": null,
|
||||||
"_isSystemFontUsed": true,
|
"_isSystemFontUsed": true,
|
||||||
"_isItalic": false,
|
"_isItalic": false,
|
||||||
"_isBold": false,
|
"_isBold": false,
|
||||||
"_isUnderline": false,
|
"_isUnderline": false,
|
||||||
"_underlineHeight": 0,
|
"_underlineHeight": 0,
|
||||||
"_cacheMode": 0,
|
"_cacheMode": 0,
|
||||||
"_spacingX": 0,
|
"_spacingX": 0,
|
||||||
"_batchAsBitmap": false,
|
"_batchAsBitmap": false,
|
||||||
"_id": "",
|
"_id": "",
|
||||||
"_enableOutline": true,
|
"_enableOutline": true,
|
||||||
"_outlineColor": {
|
"_outlineColor": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
"r": 0,
|
"r": 0,
|
||||||
"g": 0,
|
"g": 0,
|
||||||
"b": 0,
|
"b": 0,
|
||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_enableShadow": true,
|
"_enableShadow": true,
|
||||||
"_shadowOffset": {
|
"_shadowOffset": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 2,
|
"x": 2,
|
||||||
"y": 2
|
"y": 2
|
||||||
},
|
},
|
||||||
"_shadowColor": {
|
"_shadowColor": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
"r": 0,
|
"r": 0,
|
||||||
"g": 0,
|
"g": 0,
|
||||||
"b": 0,
|
"b": 0,
|
||||||
"a": 255
|
"a": 255
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "daaGzagltLmYPlAm/pJwV8"
|
"fileId": "daaGzagltLmYPlAm/pJwV8"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.LabelOutline",
|
"__type__": "cc.LabelOutline",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 2
|
"__id__": 2
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 6
|
"__id__": 6
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "d7zHQDdWFHRZVq/DT+WHoY"
|
"fileId": "d7zHQDdWFHRZVq/DT+WHoY"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.LabelShadow",
|
"__type__": "cc.LabelShadow",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 2
|
"__id__": 2
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 8
|
"__id__": 8
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "44iuI1yMdC/5FtjKBKlVsi"
|
"fileId": "44iuI1yMdC/5FtjKBKlVsi"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.UIOpacity",
|
"__type__": "cc.UIOpacity",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 2
|
"__id__": 2
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 10
|
"__id__": 10
|
||||||
},
|
},
|
||||||
"_opacity": 255
|
"_opacity": 255
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "8c6c+Ki5hNsY9S558PXdyS"
|
"fileId": "8c6c+Ki5hNsY9S558PXdyS"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.UITransform",
|
"__type__": "cc.UITransform",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 2
|
"__id__": 2
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 12
|
"__id__": 12
|
||||||
},
|
},
|
||||||
"_priority": 0,
|
"_priority": 0,
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 70.74,
|
"width": 70.74,
|
||||||
"height": 54.4
|
"height": 54.4
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0.5,
|
"x": 0.5,
|
||||||
"y": 0.5
|
"y": 0.5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "efuD+JKuBC75fHccjDZJY9"
|
"fileId": "efuD+JKuBC75fHccjDZJY9"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.PrefabInfo",
|
"__type__": "cc.PrefabInfo",
|
||||||
"root": {
|
"root": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"asset": {
|
"asset": {
|
||||||
"__id__": 0
|
"__id__": 0
|
||||||
},
|
},
|
||||||
"fileId": "e01cesJHBM4K+M5EU41LQG"
|
"fileId": "e01cesJHBM4K+M5EU41LQG"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "465f6PMtv5OqZoQeSVPvmfM",
|
"__type__": "465f6PMtv5OqZoQeSVPvmfM",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"txtScore": {
|
"txtScore": {
|
||||||
"__id__": 3
|
"__id__": 3
|
||||||
},
|
},
|
||||||
"_id": "",
|
"_id": "",
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 15
|
"__id__": 15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "3etBVQ8q9DiaShLXS1py9u"
|
"fileId": "3etBVQ8q9DiaShLXS1py9u"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.UIOpacity",
|
"__type__": "cc.UIOpacity",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 17
|
"__id__": 17
|
||||||
},
|
},
|
||||||
"_opacity": 255
|
"_opacity": 255
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "bdqeLc2vJI5KCb7AEi819K"
|
"fileId": "bdqeLc2vJI5KCb7AEi819K"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.UITransform",
|
"__type__": "cc.UITransform",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 19
|
"__id__": 19
|
||||||
},
|
},
|
||||||
"_priority": 0,
|
"_priority": 0,
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 0,
|
"width": 0,
|
||||||
"height": 0
|
"height": 0
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0.5,
|
"x": 0.5,
|
||||||
"y": 0.5
|
"y": 0.5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "7724Uz4qlOn6IBBfm0mtGt"
|
"fileId": "7724Uz4qlOn6IBBfm0mtGt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.PrefabInfo",
|
"__type__": "cc.PrefabInfo",
|
||||||
"root": {
|
"root": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"asset": {
|
"asset": {
|
||||||
"__id__": 0
|
"__id__": 0
|
||||||
},
|
},
|
||||||
"fileId": "dfcn+8f4NCm5oGvRMh0moR"
|
"fileId": "dfcn+8f4NCm5oGvRMh0moR"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.1.50",
|
"ver": "1.1.50",
|
||||||
"importer": "prefab",
|
"importer": "prefab",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "463abd5d-c3b8-4354-b614-012540a2dfb8",
|
"uuid": "463abd5d-c3b8-4354-b614-012540a2dfb8",
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"syncNodeName": "ScorePrefab"
|
"syncNodeName": "ScorePrefab"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "57936fc7-b814-41c9-9228-307c74f8d958",
|
"uuid": "57936fc7-b814-41c9-9228-307c74f8d958",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.1.50",
|
"ver": "1.1.50",
|
||||||
"importer": "scene",
|
"importer": "scene",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "49f37487-196e-48a5-ad7e-0f3f4fcc8496",
|
"uuid": "49f37487-196e-48a5-ad7e-0f3f4fcc8496",
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {}
|
"userData": {}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.1.50",
|
"ver": "1.1.50",
|
||||||
"importer": "scene",
|
"importer": "scene",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "3deca686-356b-4a89-97e0-d255f6a637b7",
|
"uuid": "3deca686-356b-4a89-97e0-d255f6a637b7",
|
||||||
"files": [
|
"files": [
|
||||||
".json"
|
".json"
|
||||||
],
|
],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {}
|
"userData": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "026faff5-3eb3-480a-9009-1bcc021dce03",
|
"uuid": "026faff5-3eb3-480a-9009-1bcc021dce03",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "1f75e345-9236-4518-97a3-9862de267a19",
|
"uuid": "1f75e345-9236-4518-97a3-9862de267a19",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "79470a7f-2ce8-48ce-86d3-e2662124378f",
|
"uuid": "79470a7f-2ce8-48ce-86d3-e2662124378f",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { _decorator } from 'cc'
|
import { _decorator } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('CommonEvent')
|
@ccclass('CommonEvent')
|
||||||
export default class CommonEvent {
|
export default class CommonEvent {
|
||||||
public static Event_FrameUpdate: string = 'Event_FrameUpdate'
|
public static Event_FrameUpdate: string = 'Event_FrameUpdate'
|
||||||
public static Event_ConnectTimeOut: string = 'Event_ConnectTimeOut'
|
public static Event_ConnectTimeOut: string = 'Event_ConnectTimeOut'
|
||||||
public static Event_ResourceLoader: string = 'Event_ResourceLoader'
|
public static Event_ResourceLoader: string = 'Event_ResourceLoader'
|
||||||
public static Event_CheckUpdate: string = 'Event_CheckUpdate'
|
public static Event_CheckUpdate: string = 'Event_CheckUpdate'
|
||||||
public static Event_Scene_Switch: string = 'Event_Scene_Switch'
|
public static Event_Scene_Switch: string = 'Event_Scene_Switch'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "76f96525-e455-4a24-9d2b-27a0cb2fdfd2",
|
"uuid": "76f96525-e455-4a24-9d2b-27a0cb2fdfd2",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
import DateUtil from '../utils/DateUtil'
|
import DateUtil from '../utils/DateUtil'
|
||||||
|
|
||||||
import NetConfig from './NetConfig'
|
import NetConfig from './NetConfig'
|
||||||
|
|
||||||
export default class ManifestConfig {
|
export default class ManifestConfig {
|
||||||
public static packageUrl: string = ''
|
public static packageUrl: string = ''
|
||||||
public static remoteManifestUrl: string = ''
|
public static remoteManifestUrl: string = ''
|
||||||
public static remoteVersionUrl: string = ''
|
public static remoteVersionUrl: string = ''
|
||||||
public static version: string = '1.0.0' // 更新包要更新这里
|
public static version: string = '1.0.0' // 更新包要更新这里
|
||||||
public static assets: object = {}
|
public static assets: object = {}
|
||||||
public static searchPaths: Array<any> = []
|
public static searchPaths: Array<any> = []
|
||||||
|
|
||||||
public static getManifestStr(key: string) {
|
public static getManifestStr(key: string) {
|
||||||
const obj: {
|
const obj: {
|
||||||
packageUrl?: string
|
packageUrl?: string
|
||||||
remoteManifestUrl?: string
|
remoteManifestUrl?: string
|
||||||
remoteVersionUrl?: string
|
remoteVersionUrl?: string
|
||||||
version?: string
|
version?: string
|
||||||
assets?: object
|
assets?: object
|
||||||
searchPaths?: Array<any>
|
searchPaths?: Array<any>
|
||||||
} = {}
|
} = {}
|
||||||
obj.packageUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/`
|
obj.packageUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/`
|
||||||
obj.remoteManifestUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/project.manifest?t=${DateUtil.now()}`
|
obj.remoteManifestUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/project.manifest?t=${DateUtil.now()}`
|
||||||
obj.remoteManifestUrl = `${
|
obj.remoteManifestUrl = `${
|
||||||
NetConfig.hotupdateUrl
|
NetConfig.hotupdateUrl
|
||||||
}/hotupdate/${key}/project.manifest?t=${DateUtil.now()}`
|
}/hotupdate/${key}/project.manifest?t=${DateUtil.now()}`
|
||||||
obj.remoteVersionUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/version.manifest?t=${DateUtil.now()}`
|
obj.remoteVersionUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/version.manifest?t=${DateUtil.now()}`
|
||||||
obj.remoteVersionUrl = `${
|
obj.remoteVersionUrl = `${
|
||||||
NetConfig.hotupdateUrl
|
NetConfig.hotupdateUrl
|
||||||
}/hotupdate/${key}/version.manifest?t=${DateUtil.now()}`
|
}/hotupdate/${key}/version.manifest?t=${DateUtil.now()}`
|
||||||
obj.version = ManifestConfig.version
|
obj.version = ManifestConfig.version
|
||||||
obj.assets = {}
|
obj.assets = {}
|
||||||
obj.searchPaths = []
|
obj.searchPaths = []
|
||||||
return JSON.stringify(obj)
|
return JSON.stringify(obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "711d7240-649f-4cb4-9d0d-06e13979eb98",
|
"uuid": "711d7240-649f-4cb4-9d0d-06e13979eb98",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,59 +1,59 @@
|
|||||||
import { AudioClip } from 'cc'
|
import { AudioClip } from 'cc'
|
||||||
|
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
|
|
||||||
export default class MusicConfig {
|
export default class MusicConfig {
|
||||||
public static musicKey2Path: Map<string, string> = new Map<string, string>() // 资源预加载路径
|
public static musicKey2Path: Map<string, string> = new Map<string, string>() // 资源预加载路径
|
||||||
|
|
||||||
public static musicKey2Cache: Map<string, AudioClip> = new Map<string, AudioClip>() // 资源加载后cache路径
|
public static musicKey2Cache: Map<string, AudioClip> = new Map<string, AudioClip>() // 资源加载后cache路径
|
||||||
|
|
||||||
public static init() {
|
public static init() {
|
||||||
if (typeof GameConfig.GameName === 'undefined' || GameConfig.GameName === null) {
|
if (typeof GameConfig.GameName === 'undefined' || GameConfig.GameName === null) {
|
||||||
console.error('GameConfig.GameName 未配置!')
|
console.error('GameConfig.GameName 未配置!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const musicConfig = {
|
const musicConfig = {
|
||||||
background_1: 'music/background_1',
|
background_1: 'music/background_1',
|
||||||
background_2: 'music/background_2',
|
background_2: 'music/background_2',
|
||||||
background_3: 'music/background_3',
|
background_3: 'music/background_3',
|
||||||
deadfish_1: 'music/deadfish_1',
|
deadfish_1: 'music/deadfish_1',
|
||||||
deadfish_2: 'music/deadfish_2',
|
deadfish_2: 'music/deadfish_2',
|
||||||
deadfish_3: 'music/deadfish_3',
|
deadfish_3: 'music/deadfish_3',
|
||||||
deadfish_4: 'music/deadfish_4',
|
deadfish_4: 'music/deadfish_4',
|
||||||
deadfish_5: 'music/deadfish_5',
|
deadfish_5: 'music/deadfish_5',
|
||||||
deadfish_6: 'music/deadfish_6',
|
deadfish_6: 'music/deadfish_6',
|
||||||
deadfish_7: 'music/deadfish_7',
|
deadfish_7: 'music/deadfish_7',
|
||||||
deadfish_8: 'music/deadfish_8',
|
deadfish_8: 'music/deadfish_8',
|
||||||
deadfish_9: 'music/deadfish_9',
|
deadfish_9: 'music/deadfish_9',
|
||||||
deadfish_10: 'music/deadfish_10',
|
deadfish_10: 'music/deadfish_10',
|
||||||
deadfish_11: 'music/deadfish_11',
|
deadfish_11: 'music/deadfish_11',
|
||||||
deadfish_12: 'music/deadfish_12',
|
deadfish_12: 'music/deadfish_12',
|
||||||
deadfish_13: 'music/deadfish_13',
|
deadfish_13: 'music/deadfish_13',
|
||||||
deadfish_14: 'music/deadfish_14',
|
deadfish_14: 'music/deadfish_14',
|
||||||
deadfish_15: 'music/deadfish_15',
|
deadfish_15: 'music/deadfish_15',
|
||||||
deadfish_16: 'music/deadfish_16',
|
deadfish_16: 'music/deadfish_16',
|
||||||
deadfish_17: 'music/deadfish_17',
|
deadfish_17: 'music/deadfish_17',
|
||||||
deadfish_18: 'music/deadfish_18',
|
deadfish_18: 'music/deadfish_18',
|
||||||
deadfish_19: 'music/deadfish_19',
|
deadfish_19: 'music/deadfish_19',
|
||||||
deadfish_20: 'music/deadfish_20',
|
deadfish_20: 'music/deadfish_20',
|
||||||
deadfish_21: 'music/deadfish_21',
|
deadfish_21: 'music/deadfish_21',
|
||||||
deadfish_22: 'music/deadfish_22',
|
deadfish_22: 'music/deadfish_22',
|
||||||
deadfish_23: 'music/deadfish_23',
|
deadfish_23: 'music/deadfish_23',
|
||||||
deadfish_24: 'music/deadfish_24',
|
deadfish_24: 'music/deadfish_24',
|
||||||
deadfish_25: 'music/deadfish_25',
|
deadfish_25: 'music/deadfish_25',
|
||||||
deadfish_26: 'music/deadfish_26',
|
deadfish_26: 'music/deadfish_26',
|
||||||
deadfish_27: 'music/deadfish_27',
|
deadfish_27: 'music/deadfish_27',
|
||||||
deadfish_28: 'music/deadfish_28',
|
deadfish_28: 'music/deadfish_28',
|
||||||
deadfish_29: 'music/deadfish_29',
|
deadfish_29: 'music/deadfish_29',
|
||||||
fire: 'music/fire',
|
fire: 'music/fire',
|
||||||
}
|
}
|
||||||
// 音乐要预加载的配置
|
// 音乐要预加载的配置
|
||||||
for (const key in musicConfig) {
|
for (const key in musicConfig) {
|
||||||
if (Object.prototype.hasOwnProperty.call(musicConfig, key)) {
|
if (Object.prototype.hasOwnProperty.call(musicConfig, key)) {
|
||||||
const path = `${GameConfig.GameName}/${musicConfig[key]}`
|
const path = `${GameConfig.GameName}/${musicConfig[key]}`
|
||||||
MusicConfig.musicKey2Path.set(key, path)
|
MusicConfig.musicKey2Path.set(key, path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "92bd7fa0-c97e-4b6f-b518-d1d4d73c03f5",
|
"uuid": "92bd7fa0-c97e-4b6f-b518-d1d4d73c03f5",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default class NetConfig {
|
export default class NetConfig {
|
||||||
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
|
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "4e758c3c-41e2-4fe7-a0ea-43fe6be9b381",
|
"uuid": "4e758c3c-41e2-4fe7-a0ea-43fe6be9b381",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "9c2b477c-5efb-432e-8d18-08cc17a2e103",
|
"uuid": "9c2b477c-5efb-432e-8d18-08cc17a2e103",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
import { Component, Label, Node, Vec3, _decorator, instantiate, tween } from 'cc'
|
import { Component, Label, Node, Vec3, _decorator, instantiate, tween } from 'cc'
|
||||||
|
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
|
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('CommonTips')
|
@ccclass('CommonTips')
|
||||||
export default class CommonTips extends Component {
|
export default class CommonTips extends Component {
|
||||||
public static TipsZorderIndex: number = 999
|
public static TipsZorderIndex: number = 999
|
||||||
@property({ type: Label })
|
@property({ type: Label })
|
||||||
txtContent: Label | null = null
|
txtContent: Label | null = null
|
||||||
|
|
||||||
private tips: string = ''
|
private tips: string = ''
|
||||||
private static showingNameList: Array<string> = []
|
private static showingNameList: Array<string> = []
|
||||||
|
|
||||||
onLoad() {}
|
onLoad() {}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
tween(this.node)
|
tween(this.node)
|
||||||
.by(1.5, { position: new Vec3(0, 100, 0) })
|
.by(1.5, { position: new Vec3(0, 100, 0) })
|
||||||
.to(0.2, { /* opacity: 0 */ scale: Vec3.ZERO })
|
.to(0.2, { /* opacity: 0 */ scale: Vec3.ZERO })
|
||||||
.call(() => {
|
.call(() => {
|
||||||
this.node.destroy()
|
this.node.destroy()
|
||||||
})
|
})
|
||||||
.start()
|
.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
const index: number = CommonTips.showingNameList.indexOf(this.tips)
|
const index: number = CommonTips.showingNameList.indexOf(this.tips)
|
||||||
CommonTips.showingNameList.splice(index, 1)
|
CommonTips.showingNameList.splice(index, 1)
|
||||||
this.unscheduleAllCallbacks()
|
this.unscheduleAllCallbacks()
|
||||||
}
|
}
|
||||||
|
|
||||||
public static showMsg(msg: string, parentNode: Node = null) {
|
public static showMsg(msg: string, parentNode: Node = null) {
|
||||||
PrefabLoader.loadPrefab(
|
PrefabLoader.loadPrefab(
|
||||||
`${GameConfig.GameName}/share/uicomponent/CommonTips`,
|
`${GameConfig.GameName}/share/uicomponent/CommonTips`,
|
||||||
(loadedResource) => {
|
(loadedResource) => {
|
||||||
parentNode = parentNode || DialogBase.GetRootCanvas()
|
parentNode = parentNode || DialogBase.GetRootCanvas()
|
||||||
if (!CommonTips.showingNameList.includes(msg)) CommonTips.showingNameList.push(msg)
|
if (!CommonTips.showingNameList.includes(msg)) CommonTips.showingNameList.push(msg)
|
||||||
|
|
||||||
const dialogNode = instantiate(loadedResource)
|
const dialogNode = instantiate(loadedResource)
|
||||||
dialogNode.setPosition(0, 0)
|
dialogNode.setPosition(0, 0)
|
||||||
const dialogScript: CommonTips = dialogNode.getComponent(CommonTips)
|
const dialogScript: CommonTips = dialogNode.getComponent(CommonTips)
|
||||||
dialogScript.tips = msg
|
dialogScript.tips = msg
|
||||||
dialogScript.txtContent.string = msg
|
dialogScript.txtContent.string = msg
|
||||||
parentNode.insertChild(dialogNode, CommonTips.TipsZorderIndex)
|
parentNode.insertChild(dialogNode, CommonTips.TipsZorderIndex)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "4524f0ef-319a-4f20-9d62-fe359bbcbc71",
|
"uuid": "4524f0ef-319a-4f20-9d62-fe359bbcbc71",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
import { Component, Node, Prefab, Widget, _decorator, instantiate } from 'cc'
|
import { Component, Node, Prefab, Widget, _decorator, instantiate } from 'cc'
|
||||||
|
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
|
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('DarkLayer')
|
@ccclass('DarkLayer')
|
||||||
export default class DarkLayer extends Component {
|
export default class DarkLayer extends Component {
|
||||||
private static prefab: Prefab
|
private static prefab: Prefab
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getComponent(Widget).target = DialogBase.GetRootCanvas()
|
this.getComponent(Widget).target = DialogBase.GetRootCanvas()
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {}
|
start() {}
|
||||||
|
|
||||||
public static preLoad(): Promise<void> {
|
public static preLoad(): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PrefabLoader.loadPrefab(
|
PrefabLoader.loadPrefab(
|
||||||
`${GameConfig.GameName}/share/uicomponent/DarkLayer`,
|
`${GameConfig.GameName}/share/uicomponent/DarkLayer`,
|
||||||
(loadedResource) => {
|
(loadedResource) => {
|
||||||
DarkLayer.prefab = loadedResource
|
DarkLayer.prefab = loadedResource
|
||||||
resolve()
|
resolve()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getDarkLayer() {
|
public static getDarkLayer() {
|
||||||
const dialogNode: Node = instantiate(DarkLayer.prefab)
|
const dialogNode: Node = instantiate(DarkLayer.prefab)
|
||||||
return dialogNode
|
return dialogNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "4fa811bd-9cd5-4ac6-ad87-d68f4a41dcdf",
|
"uuid": "4fa811bd-9cd5-4ac6-ad87-d68f4a41dcdf",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,65 +1,65 @@
|
|||||||
import { Component, Node, Widget, _decorator } from 'cc'
|
import { Component, Node, Widget, _decorator } from 'cc'
|
||||||
|
|
||||||
import { UIRoot } from '../../game/utils/UIRoot'
|
import { UIRoot } from '../../game/utils/UIRoot'
|
||||||
|
|
||||||
import DarkLayer from './DarkLayer'
|
import DarkLayer from './DarkLayer'
|
||||||
|
|
||||||
const { ccclass } = _decorator
|
const { ccclass } = _decorator
|
||||||
|
|
||||||
@ccclass('DialogBase')
|
@ccclass('DialogBase')
|
||||||
export default class DialogBase extends Component {
|
export default class DialogBase extends Component {
|
||||||
private static LocalZOrder: number = 5
|
private static LocalZOrder: number = 5
|
||||||
private darkLayer: Node | null = null
|
private darkLayer: Node | null = null
|
||||||
|
|
||||||
// private static _canvas: Node;
|
// private static _canvas: Node;
|
||||||
public static GetRootCanvas(): Node {
|
public static GetRootCanvas(): Node {
|
||||||
// if(DialogBase._canvas == null)
|
// if(DialogBase._canvas == null)
|
||||||
// DialogBase._canvas = director.getScene().getChildByName('Canvas');
|
// DialogBase._canvas = director.getScene().getChildByName('Canvas');
|
||||||
// return DialogBase._canvas;
|
// return DialogBase._canvas;
|
||||||
return UIRoot.Instance.node
|
return UIRoot.Instance.node
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
DialogBase.LocalZOrder += 1
|
DialogBase.LocalZOrder += 1
|
||||||
const closeLayer: Node = this.node.getChildByName('closeLayer')
|
const closeLayer: Node = this.node.getChildByName('closeLayer')
|
||||||
if (closeLayer) {
|
if (closeLayer) {
|
||||||
const closeLayerWidget: Widget = closeLayer.getComponent(Widget)
|
const closeLayerWidget: Widget = closeLayer.getComponent(Widget)
|
||||||
if (closeLayerWidget) {
|
if (closeLayerWidget) {
|
||||||
closeLayerWidget.target = DialogBase.GetRootCanvas()
|
closeLayerWidget.target = DialogBase.GetRootCanvas()
|
||||||
closeLayerWidget.left = 0
|
closeLayerWidget.left = 0
|
||||||
closeLayerWidget.right = 0
|
closeLayerWidget.right = 0
|
||||||
closeLayerWidget.top = 0
|
closeLayerWidget.top = 0
|
||||||
closeLayerWidget.bottom = 0
|
closeLayerWidget.bottom = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.onLoadMe()
|
this.onLoadMe()
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoadMe() {}
|
onLoadMe() {}
|
||||||
|
|
||||||
start(isPlayMv: boolean = false) {
|
start(isPlayMv: boolean = false) {
|
||||||
this.darkLayer = DarkLayer.getDarkLayer()
|
this.darkLayer = DarkLayer.getDarkLayer()
|
||||||
this.node.insertChild(this.darkLayer, 0) // this.node.addChild(this.darkLayer, -1);
|
this.node.insertChild(this.darkLayer, 0) // this.node.addChild(this.darkLayer, -1);
|
||||||
if (isPlayMv) this.node.setScale(0, 0)
|
if (isPlayMv) this.node.setScale(0, 0)
|
||||||
else this.onStartMe()
|
else this.onStartMe()
|
||||||
}
|
}
|
||||||
|
|
||||||
onStartMe() {}
|
onStartMe() {}
|
||||||
|
|
||||||
onClickClose() {
|
onClickClose() {
|
||||||
this.node.destroy()
|
this.node.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
update(dt) {
|
update(dt) {
|
||||||
this.onUpdateMe(dt)
|
this.onUpdateMe(dt)
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdateMe(dt) {}
|
onUpdateMe(dt) {}
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
DialogBase.LocalZOrder -= 1
|
DialogBase.LocalZOrder -= 1
|
||||||
this.onDestroyMe()
|
this.onDestroyMe()
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroyMe() {}
|
onDestroyMe() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "1fc7cf08-75c2-4ec4-b4c0-6f27eb483210",
|
"uuid": "1fc7cf08-75c2-4ec4-b4c0-6f27eb483210",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,76 +1,76 @@
|
|||||||
import { Component, Node, Prefab, Quat, Vec3, _decorator, instantiate } from 'cc'
|
import { Component, Node, Prefab, Quat, Vec3, _decorator, instantiate } from 'cc'
|
||||||
|
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
|
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('LoadingPrefab')
|
@ccclass('LoadingPrefab')
|
||||||
export default class LoadingPrefab extends Component {
|
export default class LoadingPrefab extends Component {
|
||||||
public static instance: Node
|
public static instance: Node
|
||||||
private static prefab: Prefab
|
private static prefab: Prefab
|
||||||
public static LoadingZorderIndex: number = 99
|
public static LoadingZorderIndex: number = 99
|
||||||
@property({ type: Node })
|
@property({ type: Node })
|
||||||
loadingSp: Node | null = null
|
loadingSp: Node | null = null
|
||||||
|
|
||||||
private _quatCache: Quat
|
private _quatCache: Quat
|
||||||
private _vec3Cache: Vec3
|
private _vec3Cache: Vec3
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this._quatCache = new Quat()
|
this._quatCache = new Quat()
|
||||||
this._vec3Cache = new Vec3()
|
this._vec3Cache = new Vec3()
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {}
|
start() {}
|
||||||
|
|
||||||
public static close() {
|
public static close() {
|
||||||
if (!LoadingPrefab.instance) return
|
if (!LoadingPrefab.instance) return
|
||||||
|
|
||||||
LoadingPrefab.instance.removeFromParent()
|
LoadingPrefab.instance.removeFromParent()
|
||||||
LoadingPrefab.instance.destroy()
|
LoadingPrefab.instance.destroy()
|
||||||
LoadingPrefab.instance = null
|
LoadingPrefab.instance = null
|
||||||
}
|
}
|
||||||
|
|
||||||
public static preLoad(): Promise<void> {
|
public static preLoad(): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PrefabLoader.loadPrefab(
|
PrefabLoader.loadPrefab(
|
||||||
`${GameConfig.GameName}/share/uicomponent/LoadingPrefab`,
|
`${GameConfig.GameName}/share/uicomponent/LoadingPrefab`,
|
||||||
(loadedResource) => {
|
(loadedResource) => {
|
||||||
LoadingPrefab.prefab = loadedResource
|
LoadingPrefab.prefab = loadedResource
|
||||||
resolve()
|
resolve()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private static createLoadingPrefab(parentNode: Node = null) {
|
private static createLoadingPrefab(parentNode: Node = null) {
|
||||||
const dialogNode: Node = instantiate(LoadingPrefab.prefab)
|
const dialogNode: Node = instantiate(LoadingPrefab.prefab)
|
||||||
LoadingPrefab.instance = dialogNode
|
LoadingPrefab.instance = dialogNode
|
||||||
if (!parentNode) parentNode = DialogBase.GetRootCanvas()
|
if (!parentNode) parentNode = DialogBase.GetRootCanvas()
|
||||||
|
|
||||||
parentNode.insertChild(dialogNode, LoadingPrefab.LoadingZorderIndex)
|
parentNode.insertChild(dialogNode, LoadingPrefab.LoadingZorderIndex)
|
||||||
dialogNode.setPosition(0, 0)
|
dialogNode.setPosition(0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async show(parentNode: Node = null) {
|
public static async show(parentNode: Node = null) {
|
||||||
if (LoadingPrefab.instance) return
|
if (LoadingPrefab.instance) return
|
||||||
if (!LoadingPrefab.prefab) await LoadingPrefab.preLoad()
|
if (!LoadingPrefab.prefab) await LoadingPrefab.preLoad()
|
||||||
|
|
||||||
this.createLoadingPrefab(parentNode)
|
this.createLoadingPrefab(parentNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
update(dt) {
|
update(dt) {
|
||||||
this.loadingSp.getRotation(this._quatCache)
|
this.loadingSp.getRotation(this._quatCache)
|
||||||
Quat.toEuler(this._vec3Cache, this._quatCache)
|
Quat.toEuler(this._vec3Cache, this._quatCache)
|
||||||
this._vec3Cache.z += 10
|
this._vec3Cache.z += 10
|
||||||
this.loadingSp.setRotationFromEuler(this._vec3Cache)
|
this.loadingSp.setRotationFromEuler(this._vec3Cache)
|
||||||
if (this._vec3Cache.z >= 360) this.loadingSp.getRotation(Quat.IDENTITY)
|
if (this._vec3Cache.z >= 360) this.loadingSp.getRotation(Quat.IDENTITY)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static clear() {
|
public static clear() {
|
||||||
LoadingPrefab.instance = null
|
LoadingPrefab.instance = null
|
||||||
LoadingPrefab.prefab = null
|
LoadingPrefab.prefab = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "172559f4-6da9-4c5d-a0b4-af9f5116f021",
|
"uuid": "172559f4-6da9-4c5d-a0b4-af9f5116f021",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,76 +1,76 @@
|
|||||||
import { Component, Node, Prefab, _decorator, instantiate } from 'cc'
|
import { Component, Node, Prefab, _decorator, instantiate } from 'cc'
|
||||||
|
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
|
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
import Progress from './Progress'
|
import Progress from './Progress'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('LoadingScenePrefab')
|
@ccclass('LoadingScenePrefab')
|
||||||
export default class LoadingScenePrefab extends Component {
|
export default class LoadingScenePrefab extends Component {
|
||||||
public static instance: Node
|
public static instance: Node
|
||||||
private static prefab: Prefab
|
private static prefab: Prefab
|
||||||
public static LoadingZorderIndex: number = 99
|
public static LoadingZorderIndex: number = 99
|
||||||
@property({ type: Node })
|
@property({ type: Node })
|
||||||
private progressNode: Node | null = null
|
private progressNode: Node | null = null
|
||||||
|
|
||||||
onLoad() {}
|
onLoad() {}
|
||||||
|
|
||||||
start() {}
|
start() {}
|
||||||
|
|
||||||
public updateProgress(completedCount: number, totalCount: number, item: any = null) {
|
public updateProgress(completedCount: number, totalCount: number, item: any = null) {
|
||||||
this.progressNode
|
this.progressNode
|
||||||
.getComponent(Progress)
|
.getComponent(Progress)
|
||||||
.updateProgress(completedCount, totalCount, '消耗流量,预下载所有"鱼"类中,请耐心等待...')
|
.updateProgress(completedCount, totalCount, '消耗流量,预下载所有"鱼"类中,请耐心等待...')
|
||||||
}
|
}
|
||||||
|
|
||||||
public static updateLoading(completedCount: number, totalCount: number, item: any = null) {
|
public static updateLoading(completedCount: number, totalCount: number, item: any = null) {
|
||||||
if (LoadingScenePrefab.instance) {
|
if (LoadingScenePrefab.instance) {
|
||||||
const nodeTs: LoadingScenePrefab =
|
const nodeTs: LoadingScenePrefab =
|
||||||
LoadingScenePrefab.instance.getComponent(LoadingScenePrefab)
|
LoadingScenePrefab.instance.getComponent(LoadingScenePrefab)
|
||||||
if (nodeTs) nodeTs.updateProgress(completedCount, totalCount, item)
|
if (nodeTs) nodeTs.updateProgress(completedCount, totalCount, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static createPrefab(parentNode: Node = null) {
|
private static createPrefab(parentNode: Node = null) {
|
||||||
const dialogNode: Node = instantiate(LoadingScenePrefab.prefab)
|
const dialogNode: Node = instantiate(LoadingScenePrefab.prefab)
|
||||||
LoadingScenePrefab.instance = dialogNode
|
LoadingScenePrefab.instance = dialogNode
|
||||||
if (!parentNode) parentNode = DialogBase.GetRootCanvas()
|
if (!parentNode) parentNode = DialogBase.GetRootCanvas()
|
||||||
|
|
||||||
parentNode.insertChild(dialogNode, LoadingScenePrefab.LoadingZorderIndex)
|
parentNode.insertChild(dialogNode, LoadingScenePrefab.LoadingZorderIndex)
|
||||||
dialogNode.setPosition(0, 0)
|
dialogNode.setPosition(0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static preLoad(): Promise<void> {
|
public static preLoad(): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PrefabLoader.loadPrefab(
|
PrefabLoader.loadPrefab(
|
||||||
`${GameConfig.GameName}/share/uicomponent/LoadingScenePrefab`,
|
`${GameConfig.GameName}/share/uicomponent/LoadingScenePrefab`,
|
||||||
(loadedResource: Prefab) => {
|
(loadedResource: Prefab) => {
|
||||||
LoadingScenePrefab.prefab = loadedResource
|
LoadingScenePrefab.prefab = loadedResource
|
||||||
resolve()
|
resolve()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public static close() {
|
public static close() {
|
||||||
if (!LoadingScenePrefab.instance) return
|
if (!LoadingScenePrefab.instance) return
|
||||||
|
|
||||||
LoadingScenePrefab.instance.destroy()
|
LoadingScenePrefab.instance.destroy()
|
||||||
LoadingScenePrefab.instance = null
|
LoadingScenePrefab.instance = null
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async show(parentNode: Node = null) {
|
public static async show(parentNode: Node = null) {
|
||||||
if (LoadingScenePrefab.instance) return
|
if (LoadingScenePrefab.instance) return
|
||||||
if (!LoadingScenePrefab.prefab) await LoadingScenePrefab.preLoad()
|
if (!LoadingScenePrefab.prefab) await LoadingScenePrefab.preLoad()
|
||||||
|
|
||||||
this.createPrefab(parentNode)
|
this.createPrefab(parentNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static clear() {
|
public static clear() {
|
||||||
LoadingScenePrefab.instance = null
|
LoadingScenePrefab.instance = null
|
||||||
LoadingScenePrefab.prefab = null
|
LoadingScenePrefab.prefab = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "e2e744b0-b723-4151-8de6-a2c222b8fe29",
|
"uuid": "e2e744b0-b723-4151-8de6-a2c222b8fe29",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +1,80 @@
|
|||||||
import {
|
import {
|
||||||
AssetManager,
|
AssetManager,
|
||||||
AudioClip,
|
AudioClip,
|
||||||
AudioSource,
|
AudioSource,
|
||||||
Component,
|
Component,
|
||||||
Prefab,
|
Prefab,
|
||||||
_decorator,
|
_decorator,
|
||||||
instantiate,
|
instantiate,
|
||||||
} from 'cc'
|
} from 'cc'
|
||||||
|
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import MusicConfig from '../config/MusicConfig'
|
import MusicConfig from '../config/MusicConfig'
|
||||||
import LocalStorage from '../utils/LocalStorage'
|
import LocalStorage from '../utils/LocalStorage'
|
||||||
import { Logger } from '../utils/Logger'
|
import { Logger } from '../utils/Logger'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 背景音乐
|
* 背景音乐
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ccclass('MusicPrefab')
|
@ccclass('MusicPrefab')
|
||||||
export default class MusicPrefab extends Component {
|
export default class MusicPrefab extends Component {
|
||||||
private static instance: MusicPrefab
|
private static instance: MusicPrefab
|
||||||
private static MUSIC_VOLUMN_KEY: string = 'musicVolumn'
|
private static MUSIC_VOLUMN_KEY: string = 'musicVolumn'
|
||||||
public static musicVolumn: number = 1
|
public static musicVolumn: number = 1
|
||||||
|
|
||||||
public static play(key: string) {
|
public static play(key: string) {
|
||||||
const url: string = MusicConfig.musicKey2Path.get(key)
|
const url: string = MusicConfig.musicKey2Path.get(key)
|
||||||
if (url) {
|
if (url) {
|
||||||
AssetManager.instance.resources.load(url, AudioClip, (error: Error, clip: AudioClip) => {
|
AssetManager.instance.resources.load(url, AudioClip, (error: Error, clip: AudioClip) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
Logger.warn(this, 'load music error===', error.message)
|
Logger.warn(this, 'load music error===', error.message)
|
||||||
} else {
|
} else {
|
||||||
if (clip) {
|
if (clip) {
|
||||||
this.instance.node.getComponent(AudioSource).clip = clip
|
this.instance.node.getComponent(AudioSource).clip = clip
|
||||||
this.instance.node.getComponent(AudioSource).volume = this.musicVolumn
|
this.instance.node.getComponent(AudioSource).volume = this.musicVolumn
|
||||||
this.instance.node.getComponent(AudioSource).play()
|
this.instance.node.getComponent(AudioSource).play()
|
||||||
this.instance.node.getComponent(AudioSource).loop = true
|
this.instance.node.getComponent(AudioSource).loop = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Logger.warn(this, '播放不存在的music=', key)
|
Logger.warn(this, '播放不存在的music=', key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static changeVolumn(nowVolumn: number) {
|
public static changeVolumn(nowVolumn: number) {
|
||||||
this.musicVolumn = nowVolumn
|
this.musicVolumn = nowVolumn
|
||||||
this.instance.node.getComponent(AudioSource).volume = nowVolumn
|
this.instance.node.getComponent(AudioSource).volume = nowVolumn
|
||||||
LocalStorage.setItem(MusicPrefab.MUSIC_VOLUMN_KEY, this.musicVolumn.toString())
|
LocalStorage.setItem(MusicPrefab.MUSIC_VOLUMN_KEY, this.musicVolumn.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
private static preInit() {
|
private static preInit() {
|
||||||
this.musicVolumn = Number.parseFloat(LocalStorage.getItem(MusicPrefab.MUSIC_VOLUMN_KEY))
|
this.musicVolumn = Number.parseFloat(LocalStorage.getItem(MusicPrefab.MUSIC_VOLUMN_KEY))
|
||||||
if (Number.isNaN(this.musicVolumn)) this.musicVolumn = 1
|
if (Number.isNaN(this.musicVolumn)) this.musicVolumn = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
public static preLoad(): Promise<void> {
|
public static preLoad(): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PrefabLoader.loadPrefab(
|
PrefabLoader.loadPrefab(
|
||||||
`${GameConfig.GameName}/share/uicomponent/MusicPrefab`,
|
`${GameConfig.GameName}/share/uicomponent/MusicPrefab`,
|
||||||
(loadedResource: Prefab) => {
|
(loadedResource: Prefab) => {
|
||||||
MusicPrefab.instance = instantiate(loadedResource).getComponent(MusicPrefab)
|
MusicPrefab.instance = instantiate(loadedResource).getComponent(MusicPrefab)
|
||||||
this.preInit()
|
this.preInit()
|
||||||
resolve()
|
resolve()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public static destory() {
|
public static destory() {
|
||||||
if (MusicPrefab.instance) {
|
if (MusicPrefab.instance) {
|
||||||
MusicPrefab.instance.getComponent(AudioSource).stop()
|
MusicPrefab.instance.getComponent(AudioSource).stop()
|
||||||
MusicPrefab.instance.destroy()
|
MusicPrefab.instance.destroy()
|
||||||
}
|
}
|
||||||
MusicPrefab.instance = null
|
MusicPrefab.instance = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "e947ef07-b958-4471-b5a5-f0acd7e299d2",
|
"uuid": "e947ef07-b958-4471-b5a5-f0acd7e299d2",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
import { Component, Label, ProgressBar, _decorator } from 'cc'
|
import { Component, Label, ProgressBar, _decorator } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('Progress')
|
@ccclass('Progress')
|
||||||
export default class Progress extends Component {
|
export default class Progress extends Component {
|
||||||
@property(Label)
|
@property(Label)
|
||||||
public percentLable: Label
|
public percentLable: Label
|
||||||
|
|
||||||
@property(ProgressBar)
|
@property(ProgressBar)
|
||||||
public bar: ProgressBar
|
public bar: ProgressBar
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.bar.node.active = false
|
this.bar.node.active = false
|
||||||
this.bar.progress = 0
|
this.bar.progress = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {}
|
start() {}
|
||||||
|
|
||||||
updatePercent(current, filePercent) {
|
updatePercent(current, filePercent) {
|
||||||
// this.percentLable.string = filePercent.toFixed(2);
|
// this.percentLable.string = filePercent.toFixed(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
updatefileTotal(current: number, filePercent: number) {
|
updatefileTotal(current: number, filePercent: number) {
|
||||||
if (!this.bar.node.active) this.bar.node.active = true
|
if (!this.bar.node.active) this.bar.node.active = true
|
||||||
let nowPercent = Math.round((current / filePercent) * 100)
|
let nowPercent = Math.round((current / filePercent) * 100)
|
||||||
const curMB = this.getMB(current)
|
const curMB = this.getMB(current)
|
||||||
const totalMB = this.getMB(filePercent)
|
const totalMB = this.getMB(filePercent)
|
||||||
// this.percentLable.string = "正在更新 " + nowPercent + "%" + " ( " + curMB + " / "+totalMB +" MB)";
|
// this.percentLable.string = "正在更新 " + nowPercent + "%" + " ( " + curMB + " / "+totalMB +" MB)";
|
||||||
nowPercent = Math.min(nowPercent, 100)
|
nowPercent = Math.min(nowPercent, 100)
|
||||||
this.percentLable.string = `正在更新 ${nowPercent}%`
|
this.percentLable.string = `正在更新 ${nowPercent}%`
|
||||||
this.bar.progress = current / filePercent
|
this.bar.progress = current / filePercent
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateProgress(
|
public updateProgress(
|
||||||
current: number,
|
current: number,
|
||||||
total: number,
|
total: number,
|
||||||
msg: string = '正在加载资源,此过程不消耗流量...',
|
msg: string = '正在加载资源,此过程不消耗流量...',
|
||||||
) {
|
) {
|
||||||
this.bar.node.active = true
|
this.bar.node.active = true
|
||||||
// this.setMsg(msg+ current + "/" + total);
|
// this.setMsg(msg+ current + "/" + total);
|
||||||
this.setMsg(msg)
|
this.setMsg(msg)
|
||||||
this.bar.progress = current / total
|
this.bar.progress = current / total
|
||||||
}
|
}
|
||||||
|
|
||||||
getMB(bytes: number) {
|
getMB(bytes: number) {
|
||||||
bytes /= 1024
|
bytes /= 1024
|
||||||
bytes /= 1024
|
bytes /= 1024
|
||||||
return bytes.toFixed(2)
|
return bytes.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
public setMsg(msg: string = '游戏加载中,请稍后...') {
|
public setMsg(msg: string = '游戏加载中,请稍后...') {
|
||||||
this.percentLable.string = msg
|
this.percentLable.string = msg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "ba38c648-abb9-41f8-a06b-830bb5aea91d",
|
"uuid": "ba38c648-abb9-41f8-a06b-830bb5aea91d",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,128 +1,128 @@
|
|||||||
import {
|
import {
|
||||||
AssetManager,
|
AssetManager,
|
||||||
AudioClip,
|
AudioClip,
|
||||||
AudioSource,
|
AudioSource,
|
||||||
Component,
|
Component,
|
||||||
Node,
|
Node,
|
||||||
NodePool,
|
NodePool,
|
||||||
Prefab,
|
Prefab,
|
||||||
_decorator,
|
_decorator,
|
||||||
instantiate,
|
instantiate,
|
||||||
} from 'cc'
|
} from 'cc'
|
||||||
|
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import CommonEvent from '../config/CommonEvent'
|
import CommonEvent from '../config/CommonEvent'
|
||||||
import MusicConfig from '../config/MusicConfig'
|
import MusicConfig from '../config/MusicConfig'
|
||||||
import EventManager from '../utils/EventManager'
|
import EventManager from '../utils/EventManager'
|
||||||
import LocalStorage from '../utils/LocalStorage'
|
import LocalStorage from '../utils/LocalStorage'
|
||||||
import { Logger } from '../utils/Logger'
|
import { Logger } from '../utils/Logger'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 音效
|
// * 音效
|
||||||
// * Ios暂时有bug,弃用
|
// * Ios暂时有bug,弃用
|
||||||
// */
|
// */
|
||||||
|
|
||||||
@ccclass('SoundPrefab')
|
@ccclass('SoundPrefab')
|
||||||
export default class SoundPrefab extends Component {
|
export default class SoundPrefab extends Component {
|
||||||
private static prefab: Prefab | null = null
|
private static prefab: Prefab | null = null
|
||||||
private static SOUND_VOLUMN_KEY: string = 'soundVolumn'
|
private static SOUND_VOLUMN_KEY: string = 'soundVolumn'
|
||||||
public static soundVolumn: number = 1
|
public static soundVolumn: number = 1
|
||||||
private static Pool_Init_Num: number = 30
|
private static Pool_Init_Num: number = 30
|
||||||
private static pool: NodePool = new NodePool()
|
private static pool: NodePool = new NodePool()
|
||||||
private static nowAudioNodeList: Array<Node> = []
|
private static nowAudioNodeList: Array<Node> = []
|
||||||
private audioName: string = ''
|
private audioName: string = ''
|
||||||
private audioUrl: string = ''
|
private audioUrl: string = ''
|
||||||
|
|
||||||
private static getAudioNode() {
|
private static getAudioNode() {
|
||||||
let node: Node = null
|
let node: Node = null
|
||||||
// if (this.pool.size() > 0) {
|
// if (this.pool.size() > 0) {
|
||||||
|
|
||||||
// node = this.pool.get();
|
// node = this.pool.get();
|
||||||
// } else {
|
// } else {
|
||||||
node = instantiate(this.prefab)
|
node = instantiate(this.prefab)
|
||||||
// }
|
// }
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
|
|
||||||
public static play(key: string) {
|
public static play(key: string) {
|
||||||
const url: string = MusicConfig.musicKey2Path.get(key)
|
const url: string = MusicConfig.musicKey2Path.get(key)
|
||||||
if (url) {
|
if (url) {
|
||||||
AssetManager.instance.resources.load(url, AudioClip, (error: Error, clip: AudioClip) => {
|
AssetManager.instance.resources.load(url, AudioClip, (error: Error, clip: AudioClip) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
Logger.warn(this, 'load sound error===', error.message)
|
Logger.warn(this, 'load sound error===', error.message)
|
||||||
} else {
|
} else {
|
||||||
if (clip) {
|
if (clip) {
|
||||||
const audioNode: Node = this.getAudioNode()
|
const audioNode: Node = this.getAudioNode()
|
||||||
if (audioNode) {
|
if (audioNode) {
|
||||||
audioNode.getComponent(AudioSource).clip = clip
|
audioNode.getComponent(AudioSource).clip = clip
|
||||||
audioNode.getComponent(AudioSource).volume = SoundPrefab.soundVolumn
|
audioNode.getComponent(AudioSource).volume = SoundPrefab.soundVolumn
|
||||||
audioNode.getComponent(AudioSource).loop = false
|
audioNode.getComponent(AudioSource).loop = false
|
||||||
audioNode.getComponent(AudioSource).currentTime = 0 // rewind();
|
audioNode.getComponent(AudioSource).currentTime = 0 // rewind();
|
||||||
audioNode.getComponent(AudioSource).play()
|
audioNode.getComponent(AudioSource).play()
|
||||||
audioNode.getComponent(SoundPrefab).audioName = key
|
audioNode.getComponent(SoundPrefab).audioName = key
|
||||||
audioNode.getComponent(SoundPrefab).audioUrl = url
|
audioNode.getComponent(SoundPrefab).audioUrl = url
|
||||||
this.nowAudioNodeList.push(audioNode)
|
this.nowAudioNodeList.push(audioNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Logger.warn(this, '播放不存在的music=', key)
|
Logger.warn(this, '播放不存在的music=', key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static changeVolumn(nowVolumn: number) {
|
public static changeVolumn(nowVolumn: number) {
|
||||||
this.soundVolumn = nowVolumn
|
this.soundVolumn = nowVolumn
|
||||||
for (let i = 0; i < this.nowAudioNodeList.length; i++) {
|
for (let i = 0; i < this.nowAudioNodeList.length; i++) {
|
||||||
const audioNode: Node = this.nowAudioNodeList[i]
|
const audioNode: Node = this.nowAudioNodeList[i]
|
||||||
const audioSource: AudioSource = audioNode.getComponent(AudioSource)
|
const audioSource: AudioSource = audioNode.getComponent(AudioSource)
|
||||||
if (audioSource.playing) audioSource.volume = nowVolumn
|
if (audioSource.playing) audioSource.volume = nowVolumn
|
||||||
}
|
}
|
||||||
LocalStorage.setItem(SoundPrefab.SOUND_VOLUMN_KEY, SoundPrefab.soundVolumn.toString())
|
LocalStorage.setItem(SoundPrefab.SOUND_VOLUMN_KEY, SoundPrefab.soundVolumn.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
private static preInit() {
|
private static preInit() {
|
||||||
EventManager.instance.addListener(CommonEvent.Event_FrameUpdate, this.updateFrame, this)
|
EventManager.instance.addListener(CommonEvent.Event_FrameUpdate, this.updateFrame, this)
|
||||||
SoundPrefab.soundVolumn = Number.parseFloat(LocalStorage.getItem(SoundPrefab.SOUND_VOLUMN_KEY))
|
SoundPrefab.soundVolumn = Number.parseFloat(LocalStorage.getItem(SoundPrefab.SOUND_VOLUMN_KEY))
|
||||||
if (Number.isNaN(SoundPrefab.soundVolumn)) SoundPrefab.soundVolumn = 1
|
if (Number.isNaN(SoundPrefab.soundVolumn)) SoundPrefab.soundVolumn = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private static updateFrame() {
|
private static updateFrame() {
|
||||||
for (let i = 0; i < this.nowAudioNodeList.length; i++) {
|
for (let i = 0; i < this.nowAudioNodeList.length; i++) {
|
||||||
const audioNode: Node = this.nowAudioNodeList[i]
|
const audioNode: Node = this.nowAudioNodeList[i]
|
||||||
const audioSource: AudioSource = audioNode.getComponent(AudioSource)
|
const audioSource: AudioSource = audioNode.getComponent(AudioSource)
|
||||||
if (!audioSource.playing) SoundPrefab.nowAudioNodeList.splice(i, 1)
|
if (!audioSource.playing) SoundPrefab.nowAudioNodeList.splice(i, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static preLoad(): Promise<void> {
|
public static preLoad(): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PrefabLoader.loadPrefab(
|
PrefabLoader.loadPrefab(
|
||||||
`${GameConfig.GameName}/share/uicomponent/SoundPrefab`,
|
`${GameConfig.GameName}/share/uicomponent/SoundPrefab`,
|
||||||
(loadedResource: Prefab) => {
|
(loadedResource: Prefab) => {
|
||||||
SoundPrefab.prefab = loadedResource
|
SoundPrefab.prefab = loadedResource
|
||||||
this.preInit()
|
this.preInit()
|
||||||
// for (let i = 0; i < this.Pool_Init_Num; i++) {
|
// for (let i = 0; i < this.Pool_Init_Num; i++) {
|
||||||
// let tempNode: cc.Node = cc.instantiate(loadedResource);
|
// let tempNode: cc.Node = cc.instantiate(loadedResource);
|
||||||
// this.pool.put(tempNode);
|
// this.pool.put(tempNode);
|
||||||
// }
|
// }
|
||||||
resolve()
|
resolve()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public static destory() {
|
public static destory() {
|
||||||
EventManager.instance.removeListener(CommonEvent.Event_FrameUpdate, this.updateFrame)
|
EventManager.instance.removeListener(CommonEvent.Event_FrameUpdate, this.updateFrame)
|
||||||
for (let i = 0; i < this.nowAudioNodeList.length; i++) {
|
for (let i = 0; i < this.nowAudioNodeList.length; i++) {
|
||||||
const audioNode: Node = this.nowAudioNodeList[i]
|
const audioNode: Node = this.nowAudioNodeList[i]
|
||||||
audioNode.getComponent(AudioSource).stop()
|
audioNode.getComponent(AudioSource).stop()
|
||||||
audioNode.getComponent(AudioSource).destroy()
|
audioNode.getComponent(AudioSource).destroy()
|
||||||
}
|
}
|
||||||
this.nowAudioNodeList = []
|
this.nowAudioNodeList = []
|
||||||
this.pool.clear()
|
this.pool.clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "d262f2b2-8af6-4db9-b1e4-0c08493efa10",
|
"uuid": "d262f2b2-8af6-4db9-b1e4-0c08493efa10",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
import { Component, SpriteFrame, _decorator } from 'cc'
|
import { Component, SpriteFrame, _decorator } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('TextureMgr')
|
@ccclass('TextureMgr')
|
||||||
export default class TextureMgr extends Component {
|
export default class TextureMgr extends Component {
|
||||||
@property({ type: [SpriteFrame] })
|
@property({ type: [SpriteFrame] })
|
||||||
public Spriteset: SpriteFrame[] = []
|
public Spriteset: SpriteFrame[] = []
|
||||||
|
|
||||||
@property({ type: [SpriteFrame] })
|
@property({ type: [SpriteFrame] })
|
||||||
public Spriteset1: SpriteFrame[] = []
|
public Spriteset1: SpriteFrame[] = []
|
||||||
|
|
||||||
@property({ type: [SpriteFrame] })
|
@property({ type: [SpriteFrame] })
|
||||||
public Spriteset2: SpriteFrame[] = []
|
public Spriteset2: SpriteFrame[] = []
|
||||||
|
|
||||||
@property({ type: [SpriteFrame] })
|
@property({ type: [SpriteFrame] })
|
||||||
public Spriteset3: SpriteFrame[] = []
|
public Spriteset3: SpriteFrame[] = []
|
||||||
|
|
||||||
@property({ type: [SpriteFrame] })
|
@property({ type: [SpriteFrame] })
|
||||||
public Spriteset4: SpriteFrame[] = []
|
public Spriteset4: SpriteFrame[] = []
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// init logic
|
// init logic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "1147cca4-2fe9-4d82-8850-0d97cb3318d5",
|
"uuid": "1147cca4-2fe9-4d82-8850-0d97cb3318d5",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "a8097de0-2f13-4b1b-be6b-4635b5d8281d",
|
"uuid": "a8097de0-2f13-4b1b-be6b-4635b5d8281d",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
import { _decorator, Canvas, error, log, view } from 'cc'
|
import { _decorator, Canvas, error, log, view } from 'cc'
|
||||||
import DialogBase from '../uicomponent/DialogBase'
|
import DialogBase from '../uicomponent/DialogBase'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('AdapterHelper')
|
@ccclass('AdapterHelper')
|
||||||
export default class AdapterHelper {
|
export default class AdapterHelper {
|
||||||
public static winSizeWidth: number
|
public static winSizeWidth: number
|
||||||
public static winSizeHeiht: number
|
public static winSizeHeiht: number
|
||||||
|
|
||||||
public static fixApdater() {
|
public static fixApdater() {
|
||||||
log('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
log('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
||||||
// return
|
// return
|
||||||
// const framesize = view.getFrameSize()
|
// const framesize = view.getFrameSize()
|
||||||
// if (!this.winSizeWidth) {
|
// if (!this.winSizeWidth) {
|
||||||
// this.winSizeWidth = screen.width
|
// this.winSizeWidth = screen.width
|
||||||
// this.winSizeHeiht = screen.height
|
// this.winSizeHeiht = screen.height
|
||||||
// }
|
// }
|
||||||
// const designsize = view.getDesignResolutionSize()
|
// const designsize = view.getDesignResolutionSize()
|
||||||
// const canvas: Canvas = DialogBase.GetRootCanvas().getComponent(Canvas)
|
// const canvas: Canvas = DialogBase.GetRootCanvas().getComponent(Canvas)
|
||||||
|
|
||||||
// const ratio: number = framesize.height / framesize.width
|
// const ratio: number = framesize.height / framesize.width
|
||||||
// const designRatio: number = designsize.height / designsize.width
|
// const designRatio: number = designsize.height / designsize.width
|
||||||
// if (ratio > designRatio) {
|
// if (ratio > designRatio) {
|
||||||
// canvas.fitHeight = false;
|
// canvas.fitHeight = false;
|
||||||
// canvas.fitWidth = true;
|
// canvas.fitWidth = true;
|
||||||
// error('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
// error('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
||||||
// } else {
|
// } else {
|
||||||
// // canvas.fitHeight = true;
|
// // canvas.fitHeight = true;
|
||||||
// // canvas.fitWidth = false;
|
// // canvas.fitWidth = false;
|
||||||
// error('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
// error('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "d2b64431-33c2-4fa1-83b0-0ece0e0a35e2",
|
"uuid": "d2b64431-33c2-4fa1-83b0-0ece0e0a35e2",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
import { _decorator } from 'cc'
|
import { _decorator } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('BitUtil')
|
@ccclass('BitUtil')
|
||||||
export default class BitUtil {
|
export default class BitUtil {
|
||||||
// index是二进制从右到左
|
// index是二进制从右到左
|
||||||
public static isBitSet(value: number, index: number): boolean {
|
public static isBitSet(value: number, index: number): boolean {
|
||||||
const str: string = value.toString(2)
|
const str: string = value.toString(2)
|
||||||
return Number.parseInt(str[str.length - 1 - index]) === 1
|
return Number.parseInt(str[str.length - 1 - index]) === 1
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从右到左计算
|
// 从右到左计算
|
||||||
public static setBitValue(value: number, index: number): number {
|
public static setBitValue(value: number, index: number): number {
|
||||||
let newValue: number = value
|
let newValue: number = value
|
||||||
const str: string = value.toString(2)
|
const str: string = value.toString(2)
|
||||||
let newStr: string = ''
|
let newStr: string = ''
|
||||||
const maxIndex = Math.max(str.length - 1, index)
|
const maxIndex = Math.max(str.length - 1, index)
|
||||||
for (let i = 0; i <= maxIndex; i++) {
|
for (let i = 0; i <= maxIndex; i++) {
|
||||||
if (index === i) {
|
if (index === i) {
|
||||||
newStr = `1${newStr}`
|
newStr = `1${newStr}`
|
||||||
} else {
|
} else {
|
||||||
if (str[i] === undefined) newStr = `0${newStr}`
|
if (str[i] === undefined) newStr = `0${newStr}`
|
||||||
else newStr = str[i] + newStr
|
else newStr = str[i] + newStr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newValue = Number.parseInt(newStr, 2)
|
newValue = Number.parseInt(newStr, 2)
|
||||||
return newValue
|
return newValue
|
||||||
}
|
}
|
||||||
|
|
||||||
public static clearBitValue(value: number, index: number) {
|
public static clearBitValue(value: number, index: number) {
|
||||||
let newValue: number = value
|
let newValue: number = value
|
||||||
const str: string = value.toString(2)
|
const str: string = value.toString(2)
|
||||||
let newStr: string = ''
|
let newStr: string = ''
|
||||||
for (let i = str.length - 1; i >= 0; i--) {
|
for (let i = str.length - 1; i >= 0; i--) {
|
||||||
if (index === str.length - 1 - i) newStr = `0${newStr}`
|
if (index === str.length - 1 - i) newStr = `0${newStr}`
|
||||||
else newStr = str[i] + newStr
|
else newStr = str[i] + newStr
|
||||||
}
|
}
|
||||||
newValue = Number.parseInt(newStr, 2)
|
newValue = Number.parseInt(newStr, 2)
|
||||||
return newValue
|
return newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "8a5aad8d-c1cf-4e6a-bbbe-bc0ef0b4d05f",
|
"uuid": "8a5aad8d-c1cf-4e6a-bbbe-bc0ef0b4d05f",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Color, _decorator } from 'cc'
|
import { Color, _decorator } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('ColorHelper')
|
@ccclass('ColorHelper')
|
||||||
export default class ColorHelper {
|
export default class ColorHelper {
|
||||||
public static getColor(hexStr: string): Color {
|
public static getColor(hexStr: string): Color {
|
||||||
const color: Color = Color.BLACK
|
const color: Color = Color.BLACK
|
||||||
return color.fromHEX(hexStr)
|
return color.fromHEX(hexStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "d1bc656e-a928-4212-a2b4-408b73ef0ec9",
|
"uuid": "d1bc656e-a928-4212-a2b4-408b73ef0ec9",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,83 +1,83 @@
|
|||||||
export default class DateUtil {
|
export default class DateUtil {
|
||||||
public static formatNumStr(num: number) {
|
public static formatNumStr(num: number) {
|
||||||
let str = `${num}`
|
let str = `${num}`
|
||||||
if (num < 10) str = `0${num}`
|
if (num < 10) str = `0${num}`
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|
||||||
public static formateYearMonthDayStr(timestamp: number) {
|
public static formateYearMonthDayStr(timestamp: number) {
|
||||||
const date: Date = new Date(timestamp)
|
const date: Date = new Date(timestamp)
|
||||||
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
|
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
public static formateMonthDayStr(timestamp: number) {
|
public static formateMonthDayStr(timestamp: number) {
|
||||||
const date: Date = new Date(timestamp)
|
const date: Date = new Date(timestamp)
|
||||||
return `${date.getMonth() + 1}月${date.getDate()}日`
|
return `${date.getMonth() + 1}月${date.getDate()}日`
|
||||||
}
|
}
|
||||||
|
|
||||||
// timestamp:1453094034000 2018-1-31 19:53:44
|
// timestamp:1453094034000 2018-1-31 19:53:44
|
||||||
// 根据时间戳返回 2018-1-31 19:53:44
|
// 根据时间戳返回 2018-1-31 19:53:44
|
||||||
public static formatDateStr(timestamp: number) {
|
public static formatDateStr(timestamp: number) {
|
||||||
const date: Date = new Date(timestamp)
|
const date: Date = new Date(timestamp)
|
||||||
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${this.formatNumStr(
|
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${this.formatNumStr(
|
||||||
date.getHours(),
|
date.getHours(),
|
||||||
)}:${this.formatNumStr(date.getMinutes())}:${this.formatNumStr(date.getSeconds())}`
|
)}:${this.formatNumStr(date.getMinutes())}:${this.formatNumStr(date.getSeconds())}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// timestamp:1453094034000 2018-1-31-19-53-44
|
// timestamp:1453094034000 2018-1-31-19-53-44
|
||||||
// 根据时间戳返回 2018-1-31-19-53-44
|
// 根据时间戳返回 2018-1-31-19-53-44
|
||||||
public static formatDateStr2(timestamp: number) {
|
public static formatDateStr2(timestamp: number) {
|
||||||
const date: Date = new Date(timestamp)
|
const date: Date = new Date(timestamp)
|
||||||
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}-${this.formatNumStr(date.getHours())}-${this.formatNumStr(date.getMinutes())}-${this.formatNumStr(date.getSeconds())}`
|
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}-${this.formatNumStr(date.getHours())}-${this.formatNumStr(date.getMinutes())}-${this.formatNumStr(date.getSeconds())}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// timestamp:1453094034000 2018-1-31
|
// timestamp:1453094034000 2018-1-31
|
||||||
// 根据时间戳返回 2018-1-31
|
// 根据时间戳返回 2018-1-31
|
||||||
public static formatDateStr3(timestamp: number) {
|
public static formatDateStr3(timestamp: number) {
|
||||||
const date: Date = new Date(timestamp)
|
const date: Date = new Date(timestamp)
|
||||||
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
|
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// timestamp:1453094034000
|
// timestamp:1453094034000
|
||||||
// 根据时间戳返回 19:53
|
// 根据时间戳返回 19:53
|
||||||
public static formatHourMinStr(timestamp: number) {
|
public static formatHourMinStr(timestamp: number) {
|
||||||
const date: Date = new Date(timestamp)
|
const date: Date = new Date(timestamp)
|
||||||
return `${this.formatNumStr(date.getHours())}:${this.formatNumStr(date.getMinutes())}`
|
return `${this.formatNumStr(date.getHours())}:${this.formatNumStr(date.getMinutes())}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// timestamp:1453094034000
|
// timestamp:1453094034000
|
||||||
// 根据时间戳返回 19:53:11
|
// 根据时间戳返回 19:53:11
|
||||||
public static formatHourMinSecondStr(timestamp: number) {
|
public static formatHourMinSecondStr(timestamp: number) {
|
||||||
const date: Date = new Date(timestamp)
|
const date: Date = new Date(timestamp)
|
||||||
return `${this.formatNumStr(date.getHours())}:${this.formatNumStr(date.getMinutes())}:${this.formatNumStr(date.getSeconds())}`
|
return `${this.formatNumStr(date.getHours())}:${this.formatNumStr(date.getMinutes())}:${this.formatNumStr(date.getSeconds())}`
|
||||||
}
|
}
|
||||||
|
|
||||||
public static now(): number {
|
public static now(): number {
|
||||||
const date: Date = new Date()
|
const date: Date = new Date()
|
||||||
return date.getTime()
|
return date.getTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
public static betweenTime(startTime: number, endTime: number) {
|
public static betweenTime(startTime: number, endTime: number) {
|
||||||
const date: Date = new Date()
|
const date: Date = new Date()
|
||||||
return date.getTime() >= startTime && date.getTime() <= endTime
|
return date.getTime() >= startTime && date.getTime() <= endTime
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据时间戳返回 1天19:53:11
|
// 根据时间戳返回 1天19:53:11
|
||||||
public static formatLeftTime(timestamp: number) {
|
public static formatLeftTime(timestamp: number) {
|
||||||
const day: number = Math.floor(timestamp / (1000 * 60 * 60 * 24))
|
const day: number = Math.floor(timestamp / (1000 * 60 * 60 * 24))
|
||||||
const hour: number = Math.floor(timestamp / (1000 * 60 * 60)) % 24
|
const hour: number = Math.floor(timestamp / (1000 * 60 * 60)) % 24
|
||||||
const min: number = Math.floor(timestamp / (1000 * 60)) % 60
|
const min: number = Math.floor(timestamp / (1000 * 60)) % 60
|
||||||
const second: number = Math.floor(timestamp / 1000) % 60
|
const second: number = Math.floor(timestamp / 1000) % 60
|
||||||
return `${day}天${this.formatNumStr(hour)}:${this.formatNumStr(min)}:${this.formatNumStr(second)}`
|
return `${day}天${this.formatNumStr(hour)}:${this.formatNumStr(min)}:${this.formatNumStr(second)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
public static isToday(dateTime: number): boolean {
|
public static isToday(dateTime: number): boolean {
|
||||||
const nowDate: Date = new Date()
|
const nowDate: Date = new Date()
|
||||||
const checkDate: Date = new Date(dateTime)
|
const checkDate: Date = new Date(dateTime)
|
||||||
return (
|
return (
|
||||||
checkDate.getFullYear() === nowDate.getFullYear() &&
|
checkDate.getFullYear() === nowDate.getFullYear() &&
|
||||||
checkDate.getMonth() === nowDate.getMonth() &&
|
checkDate.getMonth() === nowDate.getMonth() &&
|
||||||
checkDate.getDate() === nowDate.getDate()
|
checkDate.getDate() === nowDate.getDate()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "b42f778f-ca3e-4982-bd84-c8a54d39ced4",
|
"uuid": "b42f778f-ca3e-4982-bd84-c8a54d39ced4",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,123 +1,123 @@
|
|||||||
import { Button, Color, Component, Node, Slider } from 'cc'
|
import { Button, Color, Component, Node, Slider } from 'cc'
|
||||||
|
|
||||||
import ColorHelper from './ColorHelper'
|
import ColorHelper from './ColorHelper'
|
||||||
|
|
||||||
export class HaoEvent {
|
export class HaoEvent {
|
||||||
public callback: Function
|
public callback: Function
|
||||||
public caller: any
|
public caller: any
|
||||||
public isStop: boolean
|
public isStop: boolean
|
||||||
|
|
||||||
constructor(callback: Function, caller: any) {
|
constructor(callback: Function, caller: any) {
|
||||||
this.callback = callback
|
this.callback = callback
|
||||||
this.caller = caller
|
this.caller = caller
|
||||||
this.isStop = false
|
this.isStop = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class EventManager {
|
export default class EventManager {
|
||||||
public static instance: EventManager = new EventManager()
|
public static instance: EventManager = new EventManager()
|
||||||
|
|
||||||
private callbackList = {}
|
private callbackList = {}
|
||||||
|
|
||||||
public constructor() {}
|
public constructor() {}
|
||||||
|
|
||||||
// 注册事件
|
// 注册事件
|
||||||
public addListener(eventName: string, callback: Function, caller: any) {
|
public addListener(eventName: string, callback: Function, caller: any) {
|
||||||
if (this.callbackList[eventName]) {
|
if (this.callbackList[eventName]) {
|
||||||
const eventList: Array<HaoEvent> = this.callbackList[eventName]
|
const eventList: Array<HaoEvent> = this.callbackList[eventName]
|
||||||
// 不同元件才放入,相同元件覆蓋
|
// 不同元件才放入,相同元件覆蓋
|
||||||
let add: boolean = true
|
let add: boolean = true
|
||||||
for (let i = 0; i < eventList.length; i++) {
|
for (let i = 0; i < eventList.length; i++) {
|
||||||
const event: HaoEvent = eventList[i]
|
const event: HaoEvent = eventList[i]
|
||||||
if (caller === event.caller) add = false
|
if (caller === event.caller) add = false
|
||||||
}
|
}
|
||||||
if (add) {
|
if (add) {
|
||||||
eventList.push(new HaoEvent(callback, caller))
|
eventList.push(new HaoEvent(callback, caller))
|
||||||
this.callbackList[eventName] = eventList
|
this.callbackList[eventName] = eventList
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// this.callbackList[eventName] = [[callback, caller]];
|
// this.callbackList[eventName] = [[callback, caller]];
|
||||||
this.callbackList[eventName] = [new HaoEvent(callback, caller)]
|
this.callbackList[eventName] = [new HaoEvent(callback, caller)]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public removeListener(eventName: string, callback: Function) {
|
public removeListener(eventName: string, callback: Function) {
|
||||||
if (this.callbackList[eventName]) {
|
if (this.callbackList[eventName]) {
|
||||||
for (let i = this.callbackList[eventName].length - 1; i >= 0; i--) {
|
for (let i = this.callbackList[eventName].length - 1; i >= 0; i--) {
|
||||||
const event: HaoEvent = this.callbackList[eventName][i]
|
const event: HaoEvent = this.callbackList[eventName][i]
|
||||||
if (event.callback == callback) {
|
if (event.callback == callback) {
|
||||||
this.callbackList[eventName].splice(i, 1)
|
this.callbackList[eventName].splice(i, 1)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispatchEvent(eventName, parameter?: any, ...restOfName: any[]) {
|
public dispatchEvent(eventName, parameter?: any, ...restOfName: any[]) {
|
||||||
const eventList: Array<HaoEvent> = this.callbackList[eventName]
|
const eventList: Array<HaoEvent> = this.callbackList[eventName]
|
||||||
if (eventList) {
|
if (eventList) {
|
||||||
for (let i = eventList.length - 1; i >= 0; i--) {
|
for (let i = eventList.length - 1; i >= 0; i--) {
|
||||||
const event: HaoEvent = eventList[i]
|
const event: HaoEvent = eventList[i]
|
||||||
event.callback.call(event.caller, event, parameter, ...restOfName)
|
event.callback.call(event.caller, event, parameter, ...restOfName)
|
||||||
if (event.isStop) break
|
if (event.isStop) break
|
||||||
}
|
}
|
||||||
for (let i = eventList.length - 1; i >= 0; i--) {
|
for (let i = eventList.length - 1; i >= 0; i--) {
|
||||||
const event: HaoEvent = eventList[i]
|
const event: HaoEvent = eventList[i]
|
||||||
event.isStop = false
|
event.isStop = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public addBtnEvent(
|
public addBtnEvent(
|
||||||
parentNode: Node,
|
parentNode: Node,
|
||||||
objectNode: Node,
|
objectNode: Node,
|
||||||
scriptName: string,
|
scriptName: string,
|
||||||
eventName: string,
|
eventName: string,
|
||||||
data: any = null,
|
data: any = null,
|
||||||
) {
|
) {
|
||||||
const btn: Button = objectNode.addComponent(Button)
|
const btn: Button = objectNode.addComponent(Button)
|
||||||
const clickEventHandler = new Component.EventHandler()
|
const clickEventHandler = new Component.EventHandler()
|
||||||
clickEventHandler.target = parentNode // 这个 node 节点是你的事件处理代码组件所属的节点
|
clickEventHandler.target = parentNode // 这个 node 节点是你的事件处理代码组件所属的节点
|
||||||
clickEventHandler.component = scriptName // 这个是代码文件名
|
clickEventHandler.component = scriptName // 这个是代码文件名
|
||||||
clickEventHandler.handler = eventName
|
clickEventHandler.handler = eventName
|
||||||
clickEventHandler.customEventData = data
|
clickEventHandler.customEventData = data
|
||||||
btn.clickEvents.push(clickEventHandler)
|
btn.clickEvents.push(clickEventHandler)
|
||||||
this.addBtnEffect(objectNode)
|
this.addBtnEffect(objectNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
public removeBtnEvent(objectNode: Node) {
|
public removeBtnEvent(objectNode: Node) {
|
||||||
objectNode.removeComponent(Button)
|
objectNode.removeComponent(Button)
|
||||||
}
|
}
|
||||||
|
|
||||||
public removeBtnEffect(objectNode: Node) {
|
public removeBtnEffect(objectNode: Node) {
|
||||||
const b = objectNode.getComponent(Button)
|
const b = objectNode.getComponent(Button)
|
||||||
b.transition = Button.Transition.NONE
|
b.transition = Button.Transition.NONE
|
||||||
}
|
}
|
||||||
|
|
||||||
public addBtnEffect(objectNode: Node, scale: number = 1.1) {
|
public addBtnEffect(objectNode: Node, scale: number = 1.1) {
|
||||||
const b = objectNode.getComponent(Button)
|
const b = objectNode.getComponent(Button)
|
||||||
b.transition = Button.Transition.SCALE
|
b.transition = Button.Transition.SCALE
|
||||||
b.zoomScale = scale
|
b.zoomScale = scale
|
||||||
}
|
}
|
||||||
|
|
||||||
public addBtnEffect_color(
|
public addBtnEffect_color(
|
||||||
objectNode: Node,
|
objectNode: Node,
|
||||||
normalC: Color = ColorHelper.getColor('#FFFFFF'),
|
normalC: Color = ColorHelper.getColor('#FFFFFF'),
|
||||||
pressC: Color = ColorHelper.getColor('#C0C0C0'),
|
pressC: Color = ColorHelper.getColor('#C0C0C0'),
|
||||||
) {
|
) {
|
||||||
const b = objectNode.getComponent(Button)
|
const b = objectNode.getComponent(Button)
|
||||||
b.transition = Button.Transition.COLOR
|
b.transition = Button.Transition.COLOR
|
||||||
b.normalColor = normalC
|
b.normalColor = normalC
|
||||||
b.pressedColor = pressC
|
b.pressedColor = pressC
|
||||||
}
|
}
|
||||||
|
|
||||||
public addSliderEvent(parentNode: Node, objectNode: Node, EventName: string, data: any) {
|
public addSliderEvent(parentNode: Node, objectNode: Node, EventName: string, data: any) {
|
||||||
const b = objectNode.getComponent(Slider)
|
const b = objectNode.getComponent(Slider)
|
||||||
const clickEventHandler = new Component.EventHandler()
|
const clickEventHandler = new Component.EventHandler()
|
||||||
clickEventHandler.target = parentNode // 这个 node 节点是你的事件处理代码组件所属的节点
|
clickEventHandler.target = parentNode // 这个 node 节点是你的事件处理代码组件所属的节点
|
||||||
clickEventHandler.component = parentNode.name // 这个是代码文件名
|
clickEventHandler.component = parentNode.name // 这个是代码文件名
|
||||||
clickEventHandler.handler = EventName
|
clickEventHandler.handler = EventName
|
||||||
clickEventHandler.customEventData = data
|
clickEventHandler.customEventData = data
|
||||||
b.slideEvents.push(clickEventHandler)
|
b.slideEvents.push(clickEventHandler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "b7dbd2a3-1ad1-45b8-8cae-53c431e08789",
|
"uuid": "b7dbd2a3-1ad1-45b8-8cae-53c431e08789",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
export default class Grid {
|
export default class Grid {
|
||||||
public row: number
|
public row: number
|
||||||
public col: number
|
public col: number
|
||||||
|
|
||||||
constructor(row: number, col: number) {
|
constructor(row: number, col: number) {
|
||||||
this.row = row
|
this.row = row
|
||||||
this.col = col
|
this.col = col
|
||||||
}
|
}
|
||||||
|
|
||||||
public static init(row: number, col: number) {
|
public static init(row: number, col: number) {
|
||||||
return new Grid(row, col)
|
return new Grid(row, col)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "696c7042-c332-4a1a-a7f8-a898e63b35b4",
|
"uuid": "696c7042-c332-4a1a-a7f8-a898e63b35b4",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
export default class HaoEncrypt {
|
export default class HaoEncrypt {
|
||||||
public static encode(str: string) {
|
public static encode(str: string) {
|
||||||
let result: string = ''
|
let result: string = ''
|
||||||
for (let i = 0; i < str.length; i++) {
|
for (let i = 0; i < str.length; i++) {
|
||||||
// 遍历字符串
|
// 遍历字符串
|
||||||
let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值
|
let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值
|
||||||
if (i % 2 === 0) code += 2
|
if (i % 2 === 0) code += 2
|
||||||
else code += 1
|
else code += 1
|
||||||
|
|
||||||
result += String.fromCharCode(code)
|
result += String.fromCharCode(code)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public static decode(str: string) {
|
public static decode(str: string) {
|
||||||
let result: string = ''
|
let result: string = ''
|
||||||
for (let i = 0; i < str.length; i++) {
|
for (let i = 0; i < str.length; i++) {
|
||||||
// 遍历字符串
|
// 遍历字符串
|
||||||
let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值
|
let code: number = str.charCodeAt(i) // //逐个提取每个字符,并获取Unicode编码值
|
||||||
if (i % 2 === 0) code -= 2
|
if (i % 2 === 0) code -= 2
|
||||||
else code -= 1
|
else code -= 1
|
||||||
result += String.fromCharCode(code)
|
result += String.fromCharCode(code)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "87a63258-3b93-48f6-945d-5bfd9959bb70",
|
"uuid": "87a63258-3b93-48f6-945d-5bfd9959bb70",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,257 +1,257 @@
|
|||||||
import { native, sys } from 'cc'
|
import { native, sys } from 'cc'
|
||||||
|
|
||||||
import ManifestConfig from '../config/ManifestConfig'
|
import ManifestConfig from '../config/ManifestConfig'
|
||||||
|
|
||||||
import CommonTips from '../uicomponent/CommonTips'
|
import CommonTips from '../uicomponent/CommonTips'
|
||||||
|
|
||||||
import EventManager from './EventManager'
|
import EventManager from './EventManager'
|
||||||
import { Logger } from './Logger'
|
import { Logger } from './Logger'
|
||||||
import VersionManager from './VersionManager'
|
import VersionManager from './VersionManager'
|
||||||
|
|
||||||
export default class HotUpdate {
|
export default class HotUpdate {
|
||||||
public static Event_CheckUpdate: string = 'Event_CheckUpdate'
|
public static Event_CheckUpdate: string = 'Event_CheckUpdate'
|
||||||
public static Event_On_Progress: string = 'HotUpdate_Event_On_Progress'
|
public static Event_On_Progress: string = 'HotUpdate_Event_On_Progress'
|
||||||
public static Event_On_NeedUpdate: string = 'HotUpdate_Event_On_NeedUpdate'
|
public static Event_On_NeedUpdate: string = 'HotUpdate_Event_On_NeedUpdate'
|
||||||
public static Event_Finish_Update: string = 'HotUpdate_Event_Finish'
|
public static Event_Finish_Update: string = 'HotUpdate_Event_Finish'
|
||||||
public static Event_On_ALREADY_UP_TO_DATE: string = 'HotUpdate_Event_On_ALREADY_UP_TO_DATE'
|
public static Event_On_ALREADY_UP_TO_DATE: string = 'HotUpdate_Event_On_ALREADY_UP_TO_DATE'
|
||||||
public static Event_On_Fail_Update: string = 'HotUpdate_Event_On_Fail_Update'
|
public static Event_On_Fail_Update: string = 'HotUpdate_Event_On_Fail_Update'
|
||||||
private _am: any
|
private _am: any
|
||||||
private _checkListener: null
|
private _checkListener: null
|
||||||
private storagePath: string
|
private storagePath: string
|
||||||
private manifestUrl: string
|
private manifestUrl: string
|
||||||
private localBigVersion: number
|
private localBigVersion: number
|
||||||
private remoteBigVersion: number
|
private remoteBigVersion: number
|
||||||
public needUpdate: boolean = false
|
public needUpdate: boolean = false
|
||||||
public isUpdating: boolean
|
public isUpdating: boolean
|
||||||
public isFinishUpdate: boolean
|
public isFinishUpdate: boolean
|
||||||
public isCheck: boolean
|
public isCheck: boolean
|
||||||
private key: string
|
private key: string
|
||||||
private hotupdateIndex: number
|
private hotupdateIndex: number
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
public init(index: number, key: string = 'Code-remote-asset', manifestUrl: string) {
|
public init(index: number, key: string = 'Code-remote-asset', manifestUrl: string) {
|
||||||
if (sys.isNative) {
|
if (sys.isNative) {
|
||||||
this.hotupdateIndex = index
|
this.hotupdateIndex = index
|
||||||
this.key = key
|
this.key = key
|
||||||
this.manifestUrl = manifestUrl
|
this.manifestUrl = manifestUrl
|
||||||
this.storagePath = '获取this.storagePath报错了'
|
this.storagePath = '获取this.storagePath报错了'
|
||||||
|
|
||||||
Logger.log(this, 'init removeDirectory=', `${this.storagePath}_temp`)
|
Logger.log(this, 'init removeDirectory=', `${this.storagePath}_temp`)
|
||||||
}
|
}
|
||||||
this.needUpdate = false
|
this.needUpdate = false
|
||||||
this.isUpdating = false
|
this.isUpdating = false
|
||||||
this.isFinishUpdate = false
|
this.isFinishUpdate = false
|
||||||
this.isCheck = false
|
this.isCheck = false
|
||||||
}
|
}
|
||||||
|
|
||||||
private jumpToPack() {
|
private jumpToPack() {
|
||||||
let url: string
|
let url: string
|
||||||
if (sys.isNative) {
|
if (sys.isNative) {
|
||||||
if (sys.os === sys.OS.ANDROID) url = VersionManager.instance.apkStoreUrl
|
if (sys.os === sys.OS.ANDROID) url = VersionManager.instance.apkStoreUrl
|
||||||
else if (sys.os === sys.OS.IOS) url = VersionManager.instance.iosStoreUrl
|
else if (sys.os === sys.OS.IOS) url = VersionManager.instance.iosStoreUrl
|
||||||
}
|
}
|
||||||
Logger.info(this, 'jumpToPack==androidurl===', VersionManager.instance.apkStoreUrl)
|
Logger.info(this, 'jumpToPack==androidurl===', VersionManager.instance.apkStoreUrl)
|
||||||
Logger.info(this, 'jumpToPack==iosStoreUrl===', VersionManager.instance.iosStoreUrl)
|
Logger.info(this, 'jumpToPack==iosStoreUrl===', VersionManager.instance.iosStoreUrl)
|
||||||
Logger.info(this, 'jumpToPack=====', url)
|
Logger.info(this, 'jumpToPack=====', url)
|
||||||
sys.openURL(url)
|
sys.openURL(url)
|
||||||
// cc.game.end();
|
// cc.game.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示强制更新,即更细包面板
|
// 显示强制更新,即更细包面板
|
||||||
private showPackUpdateDialog() {
|
private showPackUpdateDialog() {
|
||||||
CommonTips.showMsg('有新的版本需要更新,下载后请先卸载,以前的版本,再安装!')
|
CommonTips.showMsg('有新的版本需要更新,下载后请先卸载,以前的版本,再安装!')
|
||||||
this.jumpToPack()
|
this.jumpToPack()
|
||||||
this.showPackUpdateDialog()
|
this.showPackUpdateDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkCb(event: any) {
|
private checkCb(event: any) {
|
||||||
Logger.log(this, `checkCb Code: =================${event.getEventCode()}`)
|
Logger.log(this, `checkCb Code: =================${event.getEventCode()}`)
|
||||||
switch (event.getEventCode()) {
|
switch (event.getEventCode()) {
|
||||||
case native.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
|
case native.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
|
||||||
Logger.info(this, 'No local manifest file found, hot update skipped.')
|
Logger.info(this, 'No local manifest file found, hot update skipped.')
|
||||||
this.failUpdate()
|
this.failUpdate()
|
||||||
break
|
break
|
||||||
case native.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
|
case native.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
|
||||||
case native.EventAssetsManager.ERROR_PARSE_MANIFEST:
|
case native.EventAssetsManager.ERROR_PARSE_MANIFEST:
|
||||||
Logger.info(this, 'Fail to download manifest file, hot update skipped.')
|
Logger.info(this, 'Fail to download manifest file, hot update skipped.')
|
||||||
this.failUpdate()
|
this.failUpdate()
|
||||||
break
|
break
|
||||||
case native.EventAssetsManager.ALREADY_UP_TO_DATE:
|
case native.EventAssetsManager.ALREADY_UP_TO_DATE:
|
||||||
Logger.info(this, 'Already up to date with the latest remote version.')
|
Logger.info(this, 'Already up to date with the latest remote version.')
|
||||||
this.alreadyUpToDate()
|
this.alreadyUpToDate()
|
||||||
break
|
break
|
||||||
case native.EventAssetsManager.NEW_VERSION_FOUND:
|
case native.EventAssetsManager.NEW_VERSION_FOUND:
|
||||||
Logger.info(
|
Logger.info(
|
||||||
this,
|
this,
|
||||||
'new version found, please try to update.',
|
'new version found, please try to update.',
|
||||||
this.localBigVersion,
|
this.localBigVersion,
|
||||||
this.remoteBigVersion,
|
this.remoteBigVersion,
|
||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
this.key === VersionManager.Config_Key[0] &&
|
this.key === VersionManager.Config_Key[0] &&
|
||||||
this.localBigVersion < this.remoteBigVersion
|
this.localBigVersion < this.remoteBigVersion
|
||||||
) {
|
) {
|
||||||
// 更新大版本
|
// 更新大版本
|
||||||
Logger.info(
|
Logger.info(
|
||||||
this,
|
this,
|
||||||
'new version found, please try to update======packupdate=',
|
'new version found, please try to update======packupdate=',
|
||||||
this.localBigVersion,
|
this.localBigVersion,
|
||||||
this.remoteBigVersion,
|
this.remoteBigVersion,
|
||||||
)
|
)
|
||||||
this.showPackUpdateDialog()
|
this.showPackUpdateDialog()
|
||||||
} else {
|
} else {
|
||||||
Logger.info(
|
Logger.info(
|
||||||
this,
|
this,
|
||||||
'new version found, please try to update======hotupdate=',
|
'new version found, please try to update======hotupdate=',
|
||||||
this.localBigVersion,
|
this.localBigVersion,
|
||||||
this.remoteBigVersion,
|
this.remoteBigVersion,
|
||||||
)
|
)
|
||||||
// this._am.update();
|
// this._am.update();
|
||||||
this.needUpdate = true
|
this.needUpdate = true
|
||||||
EventManager.instance.dispatchEvent(HotUpdate.Event_On_NeedUpdate, this.key)
|
EventManager.instance.dispatchEvent(HotUpdate.Event_On_NeedUpdate, this.key)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case native.EventAssetsManager.UPDATE_PROGRESSION:
|
case native.EventAssetsManager.UPDATE_PROGRESSION:
|
||||||
// var currentPercent = event.getPercent();
|
// var currentPercent = event.getPercent();
|
||||||
// var totalPercent = event.getPercentByFile();
|
// var totalPercent = event.getPercentByFile();
|
||||||
// var fileprocess = event.getDownloadedFiles() + ' / ' + event.getTotalFiles();
|
// var fileprocess = event.getDownloadedFiles() + ' / ' + event.getTotalFiles();
|
||||||
// var byteprocess = event.getDownloadedBytes() + ' / ' + event.getTotalBytes();
|
// var byteprocess = event.getDownloadedBytes() + ' / ' + event.getTotalBytes();
|
||||||
Logger.info(
|
Logger.info(
|
||||||
this,
|
this,
|
||||||
'UPDATE_PROGRESSION2222==========',
|
'UPDATE_PROGRESSION2222==========',
|
||||||
this.key,
|
this.key,
|
||||||
event.getDownloadedBytes(),
|
event.getDownloadedBytes(),
|
||||||
event.getTotalBytes(),
|
event.getTotalBytes(),
|
||||||
)
|
)
|
||||||
if (event.getTotalBytes() > 0) {
|
if (event.getTotalBytes() > 0) {
|
||||||
EventManager.instance.dispatchEvent(
|
EventManager.instance.dispatchEvent(
|
||||||
HotUpdate.Event_On_Progress,
|
HotUpdate.Event_On_Progress,
|
||||||
event.getDownloadedBytes(),
|
event.getDownloadedBytes(),
|
||||||
event.getTotalBytes(),
|
event.getTotalBytes(),
|
||||||
this.key,
|
this.key,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case native.EventAssetsManager.UPDATE_FINISHED:
|
case native.EventAssetsManager.UPDATE_FINISHED:
|
||||||
Logger.info(this, 'UPDATE_FINISHED==============')
|
Logger.info(this, 'UPDATE_FINISHED==============')
|
||||||
this.finishUpdate(true)
|
this.finishUpdate(true)
|
||||||
break
|
break
|
||||||
case native.EventAssetsManager.UPDATE_FAILED:
|
case native.EventAssetsManager.UPDATE_FAILED:
|
||||||
Logger.warn(this, 'Update failed==========', event.getMessage())
|
Logger.warn(this, 'Update failed==========', event.getMessage())
|
||||||
this.failUpdate()
|
this.failUpdate()
|
||||||
break
|
break
|
||||||
case native.EventAssetsManager.ERROR_UPDATING:
|
case native.EventAssetsManager.ERROR_UPDATING:
|
||||||
const fullFilePath: string = `${this.storagePath}/${event.getAssetId()}`
|
const fullFilePath: string = `${this.storagePath}/${event.getAssetId()}`
|
||||||
const tempFilePath: string = `${this.storagePath}_temp/${event.getAssetId()}`
|
const tempFilePath: string = `${this.storagePath}_temp/${event.getAssetId()}`
|
||||||
Logger.warn(this, 'fullFilePath====', fullFilePath)
|
Logger.warn(this, 'fullFilePath====', fullFilePath)
|
||||||
Logger.warn(this, 'tempFilePath====', tempFilePath)
|
Logger.warn(this, 'tempFilePath====', tempFilePath)
|
||||||
// jsb.fileUtils.removeFile(tempFilePath);
|
// jsb.fileUtils.removeFile(tempFilePath);
|
||||||
Logger.warn(this, 'ERROR_UPDATING=============', event.getAssetId(), event.getMessage())
|
Logger.warn(this, 'ERROR_UPDATING=============', event.getAssetId(), event.getMessage())
|
||||||
this.failUpdate()
|
this.failUpdate()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
// this.failUpdate();
|
// this.failUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public checkUpdate() {
|
public checkUpdate() {
|
||||||
if (this.isUpdating || this.isCheck) {
|
if (this.isUpdating || this.isCheck) {
|
||||||
Logger.log(this, 'Checking or updating ...')
|
Logger.log(this, 'Checking or updating ...')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const hotupdateUrlKey: string = VersionManager.Config_Url_Key[this.hotupdateIndex]
|
const hotupdateUrlKey: string = VersionManager.Config_Url_Key[this.hotupdateIndex]
|
||||||
Logger.log(this, 'checkoutUpdate=====', this.manifestUrl, hotupdateUrlKey)
|
Logger.log(this, 'checkoutUpdate=====', this.manifestUrl, hotupdateUrlKey)
|
||||||
if (!this._am) {
|
if (!this._am) {
|
||||||
this._am = new native.AssetsManager(
|
this._am = new native.AssetsManager(
|
||||||
'',
|
'',
|
||||||
this.storagePath,
|
this.storagePath,
|
||||||
this.versionCompareHandle.bind(this),
|
this.versionCompareHandle.bind(this),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// this._am.setMaxConcurrentTask(1);
|
// this._am.setMaxConcurrentTask(1);
|
||||||
const manifestStr: string = ManifestConfig.getManifestStr(hotupdateUrlKey)
|
const manifestStr: string = ManifestConfig.getManifestStr(hotupdateUrlKey)
|
||||||
Logger.log(this, 'checkUpdate=======manifestStr=======', manifestStr)
|
Logger.log(this, 'checkUpdate=======manifestStr=======', manifestStr)
|
||||||
const manifest = new native.Manifest(manifestStr, this.storagePath)
|
const manifest = new native.Manifest(manifestStr, this.storagePath)
|
||||||
this._am.setVerifyCallback((filePath, asset) => {
|
this._am.setVerifyCallback((filePath, asset) => {
|
||||||
return true
|
return true
|
||||||
// var md5 = calculateMD5(filePath);
|
// var md5 = calculateMD5(filePath);
|
||||||
// if (md5 === asset.md5)
|
// if (md5 === asset.md5)
|
||||||
// return true;
|
// return true;
|
||||||
// else
|
// else
|
||||||
// return false;
|
// return false;
|
||||||
})
|
})
|
||||||
this._am.setEventCallback(this.checkCb.bind(this))
|
this._am.setEventCallback(this.checkCb.bind(this))
|
||||||
// 设置事件回调
|
// 设置事件回调
|
||||||
this.isCheck = true
|
this.isCheck = true
|
||||||
this._am.loadLocalManifest(manifest, this.storagePath)
|
this._am.loadLocalManifest(manifest, this.storagePath)
|
||||||
this._am.checkUpdate()
|
this._am.checkUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param versionA 本地版本 1.0.0
|
* @param versionA 本地版本 1.0.0
|
||||||
* @param versionB 服务器版本 1.0.1
|
* @param versionB 服务器版本 1.0.1
|
||||||
*/
|
*/
|
||||||
private versionCompareHandle(versionA: string, versionB: string) {
|
private versionCompareHandle(versionA: string, versionB: string) {
|
||||||
const vA = versionA.split('.')
|
const vA = versionA.split('.')
|
||||||
const vB = versionB.split('.')
|
const vB = versionB.split('.')
|
||||||
Logger.log(this, 'versionCompareHandle======', this.key, VersionManager.Config_Key[0])
|
Logger.log(this, 'versionCompareHandle======', this.key, VersionManager.Config_Key[0])
|
||||||
if (this.key === VersionManager.Config_Key[0]) {
|
if (this.key === VersionManager.Config_Key[0]) {
|
||||||
Logger.log(this, 'versionCompareHandle22===', versionA, versionB)
|
Logger.log(this, 'versionCompareHandle22===', versionA, versionB)
|
||||||
VersionManager.instance.nowVersion = versionA
|
VersionManager.instance.nowVersion = versionA
|
||||||
VersionManager.instance.targetVersion = versionB
|
VersionManager.instance.targetVersion = versionB
|
||||||
}
|
}
|
||||||
this.localBigVersion = Number.parseInt(vA[0])
|
this.localBigVersion = Number.parseInt(vA[0])
|
||||||
this.remoteBigVersion = Number.parseInt(vB[0])
|
this.remoteBigVersion = Number.parseInt(vB[0])
|
||||||
for (let i = 0; i < vA.length; ++i) {
|
for (let i = 0; i < vA.length; ++i) {
|
||||||
const a = Number.parseInt(vA[i])
|
const a = Number.parseInt(vA[i])
|
||||||
const b = Number.parseInt(vB[i] || '0')
|
const b = Number.parseInt(vB[i] || '0')
|
||||||
if (a !== b) return a - b
|
if (a !== b) return a - b
|
||||||
}
|
}
|
||||||
if (vB.length > vA.length) return -1
|
if (vB.length > vA.length) return -1
|
||||||
else return 0
|
else return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
public startUpdate() {
|
public startUpdate() {
|
||||||
if (this.isUpdating) return
|
if (this.isUpdating) return
|
||||||
const localManifest = this._am.getLocalManifest()
|
const localManifest = this._am.getLocalManifest()
|
||||||
const remoteManifest = this._am.getRemoteManifest()
|
const remoteManifest = this._am.getRemoteManifest()
|
||||||
Logger.log(this, 'startUpdate111===', localManifest.getVersionFileUrl())
|
Logger.log(this, 'startUpdate111===', localManifest.getVersionFileUrl())
|
||||||
Logger.log(this, 'startUpdate2222===', localManifest.getManifestFileUrl())
|
Logger.log(this, 'startUpdate2222===', localManifest.getManifestFileUrl())
|
||||||
Logger.log(this, 'startUpdate3333===', remoteManifest.getVersionFileUrl())
|
Logger.log(this, 'startUpdate3333===', remoteManifest.getVersionFileUrl())
|
||||||
Logger.log(this, 'startUpdate4444===', remoteManifest.getManifestFileUrl())
|
Logger.log(this, 'startUpdate4444===', remoteManifest.getManifestFileUrl())
|
||||||
this.isUpdating = true
|
this.isUpdating = true
|
||||||
EventManager.instance.dispatchEvent(HotUpdate.Event_On_Progress, 0, 100, this.key)
|
EventManager.instance.dispatchEvent(HotUpdate.Event_On_Progress, 0, 100, this.key)
|
||||||
this._am.update()
|
this._am.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
public disposeUpdate() {
|
public disposeUpdate() {
|
||||||
if (this._am) {
|
if (this._am) {
|
||||||
this._am.setVerifyCallback(null)
|
this._am.setVerifyCallback(null)
|
||||||
this._am.setEventCallback(null)
|
this._am.setEventCallback(null)
|
||||||
}
|
}
|
||||||
this._am = null
|
this._am = null
|
||||||
this._checkListener = null
|
this._checkListener = null
|
||||||
this.isUpdating = false
|
this.isUpdating = false
|
||||||
this.needUpdate = false
|
this.needUpdate = false
|
||||||
}
|
}
|
||||||
|
|
||||||
private failUpdate() {
|
private failUpdate() {
|
||||||
this.disposeUpdate()
|
this.disposeUpdate()
|
||||||
this.isCheck = false
|
this.isCheck = false
|
||||||
EventManager.instance.dispatchEvent(HotUpdate.Event_On_Fail_Update, this.key)
|
EventManager.instance.dispatchEvent(HotUpdate.Event_On_Fail_Update, this.key)
|
||||||
}
|
}
|
||||||
|
|
||||||
private alreadyUpToDate() {
|
private alreadyUpToDate() {
|
||||||
this.disposeUpdate()
|
this.disposeUpdate()
|
||||||
this.isFinishUpdate = true
|
this.isFinishUpdate = true
|
||||||
EventManager.instance.dispatchEvent(HotUpdate.Event_On_ALREADY_UP_TO_DATE, this.key)
|
EventManager.instance.dispatchEvent(HotUpdate.Event_On_ALREADY_UP_TO_DATE, this.key)
|
||||||
}
|
}
|
||||||
|
|
||||||
private finishUpdate(needRestart: boolean) {
|
private finishUpdate(needRestart: boolean) {
|
||||||
Logger.info(this, '更新完成=====', needRestart)
|
Logger.info(this, '更新完成=====', needRestart)
|
||||||
this.disposeUpdate()
|
this.disposeUpdate()
|
||||||
this.isFinishUpdate = true
|
this.isFinishUpdate = true
|
||||||
EventManager.instance.dispatchEvent(HotUpdate.Event_Finish_Update, this.key, needRestart)
|
EventManager.instance.dispatchEvent(HotUpdate.Event_Finish_Update, this.key, needRestart)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "a0006bd3-77dc-49ae-991e-77aa5a70f4a6",
|
"uuid": "a0006bd3-77dc-49ae-991e-77aa5a70f4a6",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,130 +1,130 @@
|
|||||||
import { _decorator } from 'cc'
|
import { _decorator } from 'cc'
|
||||||
|
|
||||||
import { Logger } from './Logger'
|
import { Logger } from './Logger'
|
||||||
|
|
||||||
const { ccclass } = _decorator
|
const { ccclass } = _decorator
|
||||||
|
|
||||||
@ccclass('HttpClient')
|
@ccclass('HttpClient')
|
||||||
export default class HttpClient {
|
export default class HttpClient {
|
||||||
public static instance: HttpClient // = new HttpClient();
|
public static instance: HttpClient // = new HttpClient();
|
||||||
|
|
||||||
// example
|
// example
|
||||||
// HttpClient.instance.request("http://localhost:8080/haohttp/test", ()=>{
|
// HttpClient.instance.request("http://localhost:8080/haohttp/test", ()=>{
|
||||||
// console.log("http 请求 end=============");
|
// console.log("http 请求 end=============");
|
||||||
// }, {"nickName":"jhao", "hh":1, "id":9527});
|
// }, {"nickName":"jhao", "hh":1, "id":9527});
|
||||||
|
|
||||||
private methodType: string = 'GET'
|
private methodType: string = 'GET'
|
||||||
|
|
||||||
private responseType: XMLHttpRequestResponseType = 'json'
|
private responseType: XMLHttpRequestResponseType = 'json'
|
||||||
|
|
||||||
private xhr: XMLHttpRequest
|
private xhr: XMLHttpRequest
|
||||||
|
|
||||||
// --GET or POST
|
// --GET or POST
|
||||||
public setMethod(method: string = 'GET') {
|
public setMethod(method: string = 'GET') {
|
||||||
this.methodType = method
|
this.methodType = method
|
||||||
}
|
}
|
||||||
|
|
||||||
public setParams(paramsObj: object): string {
|
public setParams(paramsObj: object): string {
|
||||||
let resParams = ''
|
let resParams = ''
|
||||||
let nowIndex = 1
|
let nowIndex = 1
|
||||||
for (const key in paramsObj) {
|
for (const key in paramsObj) {
|
||||||
if (Object.prototype.hasOwnProperty.call(paramsObj, key)) {
|
if (Object.prototype.hasOwnProperty.call(paramsObj, key)) {
|
||||||
if (nowIndex === 1) resParams += `${key}=${paramsObj[key]}`
|
if (nowIndex === 1) resParams += `${key}=${paramsObj[key]}`
|
||||||
else resParams += `&${key}=${paramsObj[key]}`
|
else resParams += `&${key}=${paramsObj[key]}`
|
||||||
|
|
||||||
nowIndex += 1
|
nowIndex += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger.log(this, 'resParam===============', resParams)
|
Logger.log(this, 'resParam===============', resParams)
|
||||||
return resParams
|
return resParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public setResponseType(responseType: XMLHttpRequestResponseType) {
|
public setResponseType(responseType: XMLHttpRequestResponseType) {
|
||||||
this.responseType = responseType
|
this.responseType = responseType
|
||||||
}
|
}
|
||||||
|
|
||||||
public setContentType() {}
|
public setContentType() {}
|
||||||
|
|
||||||
public request(url: string, callback: Function, params: any = null, timeOut: number = 5 * 1000) {
|
public request(url: string, callback: Function, params: any = null, timeOut: number = 5 * 1000) {
|
||||||
if (params && this.methodType === 'GET') {
|
if (params && this.methodType === 'GET') {
|
||||||
let getParams: string = this.setParams(params)
|
let getParams: string = this.setParams(params)
|
||||||
// getParams = StringUtil:encodeURI(params)
|
// getParams = StringUtil:encodeURI(params)
|
||||||
getParams = encodeURI(getParams)
|
getParams = encodeURI(getParams)
|
||||||
url += `?${getParams}`
|
url += `?${getParams}`
|
||||||
}
|
}
|
||||||
this.xhr = new XMLHttpRequest() // http请求 fget
|
this.xhr = new XMLHttpRequest() // http请求 fget
|
||||||
// this.xhr = cc.loader.getXMLHttpRequest();
|
// this.xhr = cc.loader.getXMLHttpRequest();
|
||||||
const xhr: XMLHttpRequest = this.xhr
|
const xhr: XMLHttpRequest = this.xhr
|
||||||
xhr.responseType = this.responseType
|
xhr.responseType = this.responseType
|
||||||
xhr.timeout = timeOut
|
xhr.timeout = timeOut
|
||||||
// xhr.setRequestHeader("Content-Type", "text/plain");
|
// xhr.setRequestHeader("Content-Type", "text/plain");
|
||||||
xhr.onreadystatechange = () => {
|
xhr.onreadystatechange = () => {
|
||||||
Logger.log(this, 'status======', xhr.status, xhr.readyState, xhr.statusText)
|
Logger.log(this, 'status======', xhr.status, xhr.readyState, xhr.statusText)
|
||||||
// if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
|
// if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
|
||||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||||
const response = xhr.response
|
const response = xhr.response
|
||||||
Logger.log(this, 'http response1============', xhr)
|
Logger.log(this, 'http response1============', xhr)
|
||||||
try {
|
try {
|
||||||
const testJson = JSON.stringify(response)
|
const testJson = JSON.stringify(response)
|
||||||
Logger.log(this, 'http response json============', testJson)
|
Logger.log(this, 'http response json============', testJson)
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(true, response)
|
callback(true, response)
|
||||||
callback = null
|
callback = null
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(this, 'http response json=====error=======', error)
|
Logger.error(this, 'http response json=====error=======', error)
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(false)
|
callback(false)
|
||||||
callback = null
|
callback = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (xhr.readyState === 4 && xhr.status === 301) {
|
} else if (xhr.readyState === 4 && xhr.status === 301) {
|
||||||
// 域名转移
|
// 域名转移
|
||||||
Logger.log(this, 'http response222============', xhr.getResponseHeader('Location'))
|
Logger.log(this, 'http response222============', xhr.getResponseHeader('Location'))
|
||||||
// console.log("http response333============", xhr.getAllResponseHeaders());
|
// console.log("http response333============", xhr.getAllResponseHeaders());
|
||||||
if (HttpClient.instance == null) HttpClient.instance = new HttpClient()
|
if (HttpClient.instance == null) HttpClient.instance = new HttpClient()
|
||||||
HttpClient.instance.request(xhr.getResponseHeader('Location'), callback)
|
HttpClient.instance.request(xhr.getResponseHeader('Location'), callback)
|
||||||
} else if (xhr.readyState === 4 && xhr.status === 404) {
|
} else if (xhr.readyState === 4 && xhr.status === 404) {
|
||||||
Logger.log(this, 'http onError============')
|
Logger.log(this, 'http onError============')
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(false)
|
callback(false)
|
||||||
callback = null
|
callback = null
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Logger.log(this, 'onreadystatechange else====', xhr.status, xhr.readyState, xhr.response)
|
Logger.log(this, 'onreadystatechange else====', xhr.status, xhr.readyState, xhr.response)
|
||||||
if (xhr.readyState === 4) {
|
if (xhr.readyState === 4) {
|
||||||
Logger.log(this, 'http onError else============')
|
Logger.log(this, 'http onError else============')
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(false)
|
callback(false)
|
||||||
callback = null
|
callback = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xhr.onprogress = () => {
|
xhr.onprogress = () => {
|
||||||
Logger.log(this, 'http onprogress===', xhr.status, xhr.readyState, xhr.response)
|
Logger.log(this, 'http onprogress===', xhr.status, xhr.readyState, xhr.response)
|
||||||
}
|
}
|
||||||
xhr.onerror = () => {
|
xhr.onerror = () => {
|
||||||
Logger.log(this, 'http onError============')
|
Logger.log(this, 'http onError============')
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(false)
|
callback(false)
|
||||||
callback = null
|
callback = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xhr.ontimeout = () => {
|
xhr.ontimeout = () => {
|
||||||
Logger.log(this, 'http ontimeout============')
|
Logger.log(this, 'http ontimeout============')
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(false)
|
callback(false)
|
||||||
callback = null
|
callback = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger.log(this, 'http request==============', url)
|
Logger.log(this, 'http request==============', url)
|
||||||
Logger.log(this, 'http request======method========', this.methodType)
|
Logger.log(this, 'http request======method========', this.methodType)
|
||||||
Logger.log(this, 'http request======params========', params)
|
Logger.log(this, 'http request======params========', params)
|
||||||
xhr.open(this.methodType, url, true)
|
xhr.open(this.methodType, url, true)
|
||||||
xhr.setRequestHeader('content-type', 'text/plain;charset=UTF-8')
|
xhr.setRequestHeader('content-type', 'text/plain;charset=UTF-8')
|
||||||
xhr.send(params)
|
xhr.send(params)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInfo(callback: Function = null) {}
|
public getInfo(callback: Function = null) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "97dba6a3-a0b7-42ef-9abc-de779e8bd220",
|
"uuid": "97dba6a3-a0b7-42ef-9abc-de779e8bd220",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
import { sys } from 'cc'
|
import { sys } from 'cc'
|
||||||
|
|
||||||
export default class LocalStorage {
|
export default class LocalStorage {
|
||||||
public static GamePreFlag: string = 'fengshen-game-HaoLocalStorage'
|
public static GamePreFlag: string = 'fengshen-game-HaoLocalStorage'
|
||||||
|
|
||||||
public static setItem(key: string, value: string): void {
|
public static setItem(key: string, value: string): void {
|
||||||
sys.localStorage.setItem(LocalStorage.GamePreFlag + key, value)
|
sys.localStorage.setItem(LocalStorage.GamePreFlag + key, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getItem(key: string): string {
|
public static getItem(key: string): string {
|
||||||
return sys.localStorage.getItem(LocalStorage.GamePreFlag + key)
|
return sys.localStorage.getItem(LocalStorage.GamePreFlag + key)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static removeItem(key: string): void {
|
public static removeItem(key: string): void {
|
||||||
sys.localStorage.removeItem(LocalStorage.GamePreFlag + key)
|
sys.localStorage.removeItem(LocalStorage.GamePreFlag + key)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getInt(key: string): number {
|
public static getInt(key: string): number {
|
||||||
const tempValue: string = LocalStorage.getItem(key)
|
const tempValue: string = LocalStorage.getItem(key)
|
||||||
let result: number = 0
|
let result: number = 0
|
||||||
if (tempValue) result = Number.parseInt(tempValue)
|
if (tempValue) result = Number.parseInt(tempValue)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public static setInt(key: string, value: number): void {
|
public static setInt(key: string, value: number): void {
|
||||||
LocalStorage.setItem(key, value.toString())
|
LocalStorage.setItem(key, value.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getFloat(key: string): number {
|
public static getFloat(key: string): number {
|
||||||
const tempValue: string = LocalStorage.getItem(key)
|
const tempValue: string = LocalStorage.getItem(key)
|
||||||
let result: number = 0
|
let result: number = 0
|
||||||
if (tempValue) result = Number.parseFloat(tempValue)
|
if (tempValue) result = Number.parseFloat(tempValue)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public static setFloat(key: string, value: number): void {
|
public static setFloat(key: string, value: number): void {
|
||||||
LocalStorage.setItem(key, value.toString())
|
LocalStorage.setItem(key, value.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getBoolean(key: string): boolean {
|
public static getBoolean(key: string): boolean {
|
||||||
const temp: number = LocalStorage.getInt(key)
|
const temp: number = LocalStorage.getInt(key)
|
||||||
return temp === 1
|
return temp === 1
|
||||||
}
|
}
|
||||||
|
|
||||||
public static setBoolean(key: string, value: boolean) {
|
public static setBoolean(key: string, value: boolean) {
|
||||||
if (value) LocalStorage.setInt(key, 1)
|
if (value) LocalStorage.setInt(key, 1)
|
||||||
else LocalStorage.setInt(key, 0)
|
else LocalStorage.setInt(key, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static clear() {
|
public static clear() {
|
||||||
sys.localStorage.clear()
|
sys.localStorage.clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "6ac377cd-dfa3-4928-ae69-ae600d9aabb1",
|
"uuid": "6ac377cd-dfa3-4928-ae69-ae600d9aabb1",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,86 +1,86 @@
|
|||||||
class LOG_LEVEL_TYPES {
|
class LOG_LEVEL_TYPES {
|
||||||
public static DEBUG = 0
|
public static DEBUG = 0
|
||||||
public static LOG = 1
|
public static LOG = 1
|
||||||
public static INFO = 2
|
public static INFO = 2
|
||||||
public static WARN = 3
|
public static WARN = 3
|
||||||
public static ERROR = 4
|
public static ERROR = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
const Log_Level_Names: Array<string> = ['debug', 'log', 'info', 'warn', 'error']
|
const Log_Level_Names: Array<string> = ['debug', 'log', 'info', 'warn', 'error']
|
||||||
|
|
||||||
export class Logger {
|
export class Logger {
|
||||||
public static tag: string = '[HaoJslog]' // 可以设置当前游戏的前缀
|
public static tag: string = '[HaoJslog]' // 可以设置当前游戏的前缀
|
||||||
public static LEVEL: number = LOG_LEVEL_TYPES.WARN // 当前Logger等级
|
public static LEVEL: number = LOG_LEVEL_TYPES.WARN // 当前Logger等级
|
||||||
public static Log_Color_Config: Array<string> = [
|
public static Log_Color_Config: Array<string> = [
|
||||||
'color:#890;font-size:10px;',
|
'color:#890;font-size:10px;',
|
||||||
'color:#000;font-size:11px;',
|
'color:#000;font-size:11px;',
|
||||||
'color:#09f;font-size:12px;',
|
'color:#09f;font-size:12px;',
|
||||||
'color:#f90;font-size:13px;',
|
'color:#f90;font-size:13px;',
|
||||||
'color:#f00;font-size:15px;',
|
'color:#f00;font-size:15px;',
|
||||||
]
|
]
|
||||||
|
|
||||||
private static Terminal_Log: boolean = false
|
private static Terminal_Log: boolean = false
|
||||||
|
|
||||||
public static formatNow() {
|
public static formatNow() {
|
||||||
const date: Date = new Date() // 后端返回的时间戳是秒
|
const date: Date = new Date() // 后端返回的时间戳是秒
|
||||||
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}:${date.getMilliseconds()}`
|
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}:${date.getMilliseconds()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getLogPreKey(nowLevel: number): string {
|
private static getLogPreKey(nowLevel: number): string {
|
||||||
return `[${Logger.formatNow()}] ${Logger.tag} [${Log_Level_Names[nowLevel]}] `
|
return `[${Logger.formatNow()}] ${Logger.tag} [${Log_Level_Names[nowLevel]}] `
|
||||||
}
|
}
|
||||||
|
|
||||||
public static debug(...params: any) {
|
public static debug(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.DEBUG)
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.DEBUG)
|
||||||
return
|
return
|
||||||
|
|
||||||
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.DEBUG)
|
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.DEBUG)
|
||||||
const fileStr: string = str + params.join(' ')
|
const fileStr: string = str + params.join(' ')
|
||||||
// LogErrorFileUtil.debug(fileStr);
|
// LogErrorFileUtil.debug(fileStr);
|
||||||
if (this.Terminal_Log)
|
if (this.Terminal_Log)
|
||||||
console.log(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
console.log(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
||||||
else console.info(fileStr)
|
else console.info(fileStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static log(...params: any) {
|
public static log(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.LOG)
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.LOG)
|
||||||
return
|
return
|
||||||
|
|
||||||
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.LOG)
|
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.LOG)
|
||||||
const fileStr: string = str + params.join(' ')
|
const fileStr: string = str + params.join(' ')
|
||||||
// LogErrorFileUtil.log(fileStr);
|
// LogErrorFileUtil.log(fileStr);
|
||||||
if (this.Terminal_Log)
|
if (this.Terminal_Log)
|
||||||
console.log(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
console.log(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
||||||
else console.info(fileStr) // console.log(str, ...params)
|
else console.info(fileStr) // console.log(str, ...params)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static info(...params: any) {
|
public static info(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.INFO) return
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.INFO) return
|
||||||
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.INFO)
|
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.INFO)
|
||||||
const fileStr: string = str + params.join(' ')
|
const fileStr: string = str + params.join(' ')
|
||||||
if (this.Terminal_Log)
|
if (this.Terminal_Log)
|
||||||
console.info(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
console.info(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
||||||
else console.info(fileStr)
|
else console.info(fileStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static warn(...params: any) {
|
public static warn(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.WARN)
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.WARN)
|
||||||
return
|
return
|
||||||
|
|
||||||
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.WARN)
|
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.WARN)
|
||||||
const fileStr: string = str + params.join(' ')
|
const fileStr: string = str + params.join(' ')
|
||||||
if (this.Terminal_Log)
|
if (this.Terminal_Log)
|
||||||
console.warn(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
console.warn(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
||||||
else console.warn(fileStr)
|
else console.warn(fileStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static error(...params: any) {
|
public static error(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.ERROR) return
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.ERROR) return
|
||||||
|
|
||||||
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.ERROR)
|
const str: string = this.getLogPreKey(LOG_LEVEL_TYPES.ERROR)
|
||||||
const fileStr: string = str + params.join(' ')
|
const fileStr: string = str + params.join(' ')
|
||||||
if (this.Terminal_Log)
|
if (this.Terminal_Log)
|
||||||
console.error(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
console.error(`%c${str}`, this.Log_Color_Config[LOG_LEVEL_TYPES.DEBUG], ...params)
|
||||||
else console.error(fileStr)
|
else console.error(fileStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "64f5d910-1b40-421a-a57e-315335fd7b33",
|
"uuid": "64f5d910-1b40-421a-a57e-315335fd7b33",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,61 +1,61 @@
|
|||||||
import { Vec2 } from 'cc'
|
import { Vec2 } from 'cc'
|
||||||
|
|
||||||
export default class MathUtils {
|
export default class MathUtils {
|
||||||
/**
|
/**
|
||||||
* 2个点之前的直线距离
|
* 2个点之前的直线距离
|
||||||
* @param x1
|
* @param x1
|
||||||
* @param y1
|
* @param y1
|
||||||
* @param x2
|
* @param x2
|
||||||
* @param y2
|
* @param y2
|
||||||
*/
|
*/
|
||||||
public static distance(x1: number, y1: number, x2: number, y2: number) {
|
public static distance(x1: number, y1: number, x2: number, y2: number) {
|
||||||
// 设两点A(X1,Y1),B(X2,Y2)
|
// 设两点A(X1,Y1),B(X2,Y2)
|
||||||
// 距离D=(X2-X1)的平方+(Y2-Y1)平方的和开平方
|
// 距离D=(X2-X1)的平方+(Y2-Y1)平方的和开平方
|
||||||
return Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
|
return Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2点间的向量
|
* 2点间的向量
|
||||||
* @param p1
|
* @param p1
|
||||||
* @param p2
|
* @param p2
|
||||||
*/
|
*/
|
||||||
public static sub(p1: Vec2, p2: Vec2) {
|
public static sub(p1: Vec2, p2: Vec2) {
|
||||||
return new Vec2(p1.x - p2.x, p1.y - p2.y)
|
return new Vec2(p1.x - p2.x, p1.y - p2.y)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 弧度转角度
|
* 弧度转角度
|
||||||
* @param radians
|
* @param radians
|
||||||
*/
|
*/
|
||||||
public static radiansToDegrees(radians: number) {
|
public static radiansToDegrees(radians: number) {
|
||||||
return (180 / Math.PI) * radians
|
return (180 / Math.PI) * radians
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角度转弧度
|
* 角度转弧度
|
||||||
* @param degrees
|
* @param degrees
|
||||||
*/
|
*/
|
||||||
public static degreesToRadians(degrees: number) {
|
public static degreesToRadians(degrees: number) {
|
||||||
return (Math.PI * degrees) / 180
|
return (Math.PI * degrees) / 180
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回2点间的弧度
|
* 返回2点间的弧度
|
||||||
* @param startP
|
* @param startP
|
||||||
* @param endP
|
* @param endP
|
||||||
*/
|
*/
|
||||||
public static p2pRad(startP: Vec2, endP: Vec2) {
|
public static p2pRad(startP: Vec2, endP: Vec2) {
|
||||||
const rad: number = Math.atan2(endP.y - startP.y, endP.x - startP.x)
|
const rad: number = Math.atan2(endP.y - startP.y, endP.x - startP.x)
|
||||||
return rad
|
return rad
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对捕鱼鱼的方向特定实现的鱼方向转换
|
* 针对捕鱼鱼的方向特定实现的鱼方向转换
|
||||||
* @param rot
|
* @param rot
|
||||||
*/
|
*/
|
||||||
public static rotation2Fish(rot: number) {
|
public static rotation2Fish(rot: number) {
|
||||||
if (rot >= 0 && rot <= 180) rot = 180 - rot
|
if (rot >= 0 && rot <= 180) rot = 180 - rot
|
||||||
else rot = -180 - rot
|
else rot = -180 - rot
|
||||||
return rot
|
return rot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "93c7eb99-4e1c-4343-9017-b8511388166a",
|
"uuid": "93c7eb99-4e1c-4343-9017-b8511388166a",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,63 +1,63 @@
|
|||||||
import { Node, Vec2, Vec3 } from 'cc'
|
import { Node, Vec2, Vec3 } from 'cc'
|
||||||
|
|
||||||
import MathUtils from './MathUtils'
|
import MathUtils from './MathUtils'
|
||||||
|
|
||||||
export class MoveHelper {
|
export class MoveHelper {
|
||||||
public static _vec3: Vec3 = new Vec3()
|
public static _vec3: Vec3 = new Vec3()
|
||||||
public static _vec2_0: Vec2 = new Vec2()
|
public static _vec2_0: Vec2 = new Vec2()
|
||||||
public static _vec2_1: Vec2 = new Vec2()
|
public static _vec2_1: Vec2 = new Vec2()
|
||||||
|
|
||||||
public static moveNode(
|
public static moveNode(
|
||||||
moveNode: Node,
|
moveNode: Node,
|
||||||
speed: number,
|
speed: number,
|
||||||
tx: number,
|
tx: number,
|
||||||
ty: number,
|
ty: number,
|
||||||
minSpeed: number = 0.01,
|
minSpeed: number = 0.01,
|
||||||
) {
|
) {
|
||||||
let isMoving: boolean = false
|
let isMoving: boolean = false
|
||||||
let times: number = 0
|
let times: number = 0
|
||||||
moveNode.getPosition(MoveHelper._vec3)
|
moveNode.getPosition(MoveHelper._vec3)
|
||||||
MoveHelper._vec2_0.x = MoveHelper._vec3.x
|
MoveHelper._vec2_0.x = MoveHelper._vec3.x
|
||||||
MoveHelper._vec2_0.y = MoveHelper._vec3.y
|
MoveHelper._vec2_0.y = MoveHelper._vec3.y
|
||||||
MoveHelper._vec2_1.x = tx
|
MoveHelper._vec2_1.x = tx
|
||||||
MoveHelper._vec2_1.y = ty
|
MoveHelper._vec2_1.y = ty
|
||||||
const rad: number = MathUtils.p2pRad(MoveHelper._vec2_0, MoveHelper._vec2_1)
|
const rad: number = MathUtils.p2pRad(MoveHelper._vec2_0, MoveHelper._vec2_1)
|
||||||
const speedX: number = speed * Math.cos(rad)
|
const speedX: number = speed * Math.cos(rad)
|
||||||
const speedY: number = speed * Math.sin(rad)
|
const speedY: number = speed * Math.sin(rad)
|
||||||
if (Math.abs(MoveHelper._vec3.x - tx) > minSpeed) {
|
if (Math.abs(MoveHelper._vec3.x - tx) > minSpeed) {
|
||||||
times = Math.floor(Math.abs(speedX / minSpeed))
|
times = Math.floor(Math.abs(speedX / minSpeed))
|
||||||
for (let i = 0; i < times; i++) {
|
for (let i = 0; i < times; i++) {
|
||||||
if (MoveHelper._vec3.x > tx) {
|
if (MoveHelper._vec3.x > tx) {
|
||||||
MoveHelper._vec3.x -= minSpeed
|
MoveHelper._vec3.x -= minSpeed
|
||||||
moveNode.setPosition(MoveHelper._vec3)
|
moveNode.setPosition(MoveHelper._vec3)
|
||||||
} else {
|
} else {
|
||||||
MoveHelper._vec3.x += minSpeed
|
MoveHelper._vec3.x += minSpeed
|
||||||
moveNode.setPosition(MoveHelper._vec3)
|
moveNode.setPosition(MoveHelper._vec3)
|
||||||
}
|
}
|
||||||
if (Math.abs(MoveHelper._vec3.x - tx) <= minSpeed * 2) {
|
if (Math.abs(MoveHelper._vec3.x - tx) <= minSpeed * 2) {
|
||||||
MoveHelper._vec3.x = tx
|
MoveHelper._vec3.x = tx
|
||||||
moveNode.setPosition(MoveHelper._vec3)
|
moveNode.setPosition(MoveHelper._vec3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isMoving = true
|
isMoving = true
|
||||||
}
|
}
|
||||||
if (Math.abs(MoveHelper._vec3.y - ty) > minSpeed) {
|
if (Math.abs(MoveHelper._vec3.y - ty) > minSpeed) {
|
||||||
times = Math.floor(Math.abs(speedY / minSpeed))
|
times = Math.floor(Math.abs(speedY / minSpeed))
|
||||||
for (let j = 0; j < times; j++) {
|
for (let j = 0; j < times; j++) {
|
||||||
if (MoveHelper._vec3.y > ty) {
|
if (MoveHelper._vec3.y > ty) {
|
||||||
MoveHelper._vec3.y -= minSpeed
|
MoveHelper._vec3.y -= minSpeed
|
||||||
moveNode.setPosition(MoveHelper._vec3)
|
moveNode.setPosition(MoveHelper._vec3)
|
||||||
} else {
|
} else {
|
||||||
MoveHelper._vec3.y += minSpeed
|
MoveHelper._vec3.y += minSpeed
|
||||||
moveNode.setPosition(MoveHelper._vec3)
|
moveNode.setPosition(MoveHelper._vec3)
|
||||||
}
|
}
|
||||||
if (Math.abs(MoveHelper._vec3.x - ty) <= minSpeed * 2) {
|
if (Math.abs(MoveHelper._vec3.x - ty) <= minSpeed * 2) {
|
||||||
MoveHelper._vec3.y = ty
|
MoveHelper._vec3.y = ty
|
||||||
moveNode.setPosition(MoveHelper._vec3)
|
moveNode.setPosition(MoveHelper._vec3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isMoving = true
|
isMoving = true
|
||||||
}
|
}
|
||||||
return isMoving
|
return isMoving
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "4304fd05-cb03-46da-a6a6-f742febe535e",
|
"uuid": "4304fd05-cb03-46da-a6a6-f742febe535e",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
import { AssetManager, Prefab, _decorator } from 'cc'
|
import { AssetManager, Prefab, _decorator } from 'cc'
|
||||||
|
|
||||||
import { Logger } from './Logger'
|
import { Logger } from './Logger'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('PrefabLoader')
|
@ccclass('PrefabLoader')
|
||||||
export default class PrefabLoader {
|
export default class PrefabLoader {
|
||||||
private static isLoading: boolean = false
|
private static isLoading: boolean = false
|
||||||
|
|
||||||
public static loadPrefab(url: string, callback: Function) {
|
public static loadPrefab(url: string, callback: Function) {
|
||||||
if (this.isLoading) return
|
if (this.isLoading) return
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
AssetManager.instance.resources.load(url, Prefab, (error: Error, loadedResource) => {
|
AssetManager.instance.resources.load(url, Prefab, (error: Error, loadedResource) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
Logger.warn(this, '载入Prefab失败, 原因:', url, error.message)
|
Logger.warn(this, '载入Prefab失败, 原因:', url, error.message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!(loadedResource instanceof Prefab)) {
|
if (!(loadedResource instanceof Prefab)) {
|
||||||
Logger.warn(this, '你载入的不是Prefab, 你做了什么事?')
|
Logger.warn(this, '你载入的不是Prefab, 你做了什么事?')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
callback(loadedResource)
|
callback(loadedResource)
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "10db6736-1255-4a28-91a1-fe4c41312d29",
|
"uuid": "10db6736-1255-4a28-91a1-fe4c41312d29",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
import { Vec2 } from 'cc'
|
import { Vec2 } from 'cc'
|
||||||
|
|
||||||
export default class RandomUtil {
|
export default class RandomUtil {
|
||||||
// 随机minNum到maxNum的数字 (包含maxNum)
|
// 随机minNum到maxNum的数字 (包含maxNum)
|
||||||
public static nextInt(minNum: number, maxNum: number) {
|
public static nextInt(minNum: number, maxNum: number) {
|
||||||
return Math.floor(Math.random() * (maxNum - minNum + 1) + minNum)
|
return Math.floor(Math.random() * (maxNum - minNum + 1) + minNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static nextNumber(minNum: number, maxNum: number) {
|
public static nextNumber(minNum: number, maxNum: number) {
|
||||||
return Math.random() * (maxNum - minNum) + minNum
|
return Math.random() * (maxNum - minNum) + minNum
|
||||||
}
|
}
|
||||||
|
|
||||||
public static nextSign() {
|
public static nextSign() {
|
||||||
const temp = Math.random()
|
const temp = Math.random()
|
||||||
if (temp < 0.5) return 1
|
if (temp < 0.5) return 1
|
||||||
|
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
public static nextBoolean() {
|
public static nextBoolean() {
|
||||||
const temp = Math.random()
|
const temp = Math.random()
|
||||||
return temp < 0.5
|
return temp < 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
public static randomArr(nowArr: Array<any>, needNum: number) {
|
public static randomArr(nowArr: Array<any>, needNum: number) {
|
||||||
const tempArr: Array<any> = nowArr.concat()
|
const tempArr: Array<any> = nowArr.concat()
|
||||||
const resultArr: Array<any> = []
|
const resultArr: Array<any> = []
|
||||||
for (let index = 0; index < needNum; index++) {
|
for (let index = 0; index < needNum; index++) {
|
||||||
if (tempArr.length <= 0) break
|
if (tempArr.length <= 0) break
|
||||||
|
|
||||||
const randomIndex: number = RandomUtil.nextInt(0, tempArr.length - 1)
|
const randomIndex: number = RandomUtil.nextInt(0, tempArr.length - 1)
|
||||||
resultArr.push(tempArr.splice(randomIndex, 1)[0])
|
resultArr.push(tempArr.splice(randomIndex, 1)[0])
|
||||||
}
|
}
|
||||||
return resultArr
|
return resultArr
|
||||||
}
|
}
|
||||||
|
|
||||||
public static randomItem(nowArr: Array<any>) {
|
public static randomItem(nowArr: Array<any>) {
|
||||||
return this.randomArr(nowArr, 1)[0]
|
return this.randomArr(nowArr, 1)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
public static randomP(left: number, right: number, up: number, down: number) {
|
public static randomP(left: number, right: number, up: number, down: number) {
|
||||||
const randomX: number = RandomUtil.nextNumber(left, right)
|
const randomX: number = RandomUtil.nextNumber(left, right)
|
||||||
const randomY: number = RandomUtil.nextNumber(up, down)
|
const randomY: number = RandomUtil.nextNumber(up, down)
|
||||||
return new Vec2(randomX, randomY)
|
return new Vec2(randomX, randomY)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "09813185-c544-4799-88cd-3134aa4da011",
|
"uuid": "09813185-c544-4799-88cd-3134aa4da011",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,383 +1,383 @@
|
|||||||
import { Color, Material, Node, UIRenderer, UITransform, Vec2 } from 'cc'
|
import { Color, Material, Node, UIRenderer, UITransform, Vec2 } from 'cc'
|
||||||
|
|
||||||
import ShaderMaterialPrefab from '../../game/prefab/ShaderMaterialPrefab'
|
import ShaderMaterialPrefab from '../../game/prefab/ShaderMaterialPrefab'
|
||||||
|
|
||||||
export default class ShaderHelper {
|
export default class ShaderHelper {
|
||||||
/**
|
/**
|
||||||
* 清除所有shader
|
* 清除所有shader
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static clearAllEffect(
|
public static clearAllEffect(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).default,
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).default,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置图片灰白程度
|
* 设置图片灰白程度
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param grayLevel
|
* @param grayLevel
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setGrayEffect(
|
public static setGrayEffect(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
grayLevel: number = 1,
|
grayLevel: number = 1,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab)
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab)
|
||||||
.grayMaterial,
|
.grayMaterial,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('grayLevel', grayLevel)
|
material.setProperty('grayLevel', grayLevel)
|
||||||
renderComponent.setMaterial(material, 0)
|
renderComponent.setMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('grayLevel', grayLevel)
|
material.setProperty('grayLevel', grayLevel)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 播放变灰过程动画
|
* 播放变灰过程动画
|
||||||
*/
|
*/
|
||||||
public static showGrayMv(showNode: Node) {
|
public static showGrayMv(showNode: Node) {
|
||||||
let grayValue: number = 0.5
|
let grayValue: number = 0.5
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
grayValue += 0.01
|
grayValue += 0.01
|
||||||
if (grayValue >= 1) {
|
if (grayValue >= 1) {
|
||||||
grayValue = 1
|
grayValue = 1
|
||||||
clearInterval(intervalId)
|
clearInterval(intervalId)
|
||||||
}
|
}
|
||||||
if (showNode) ShaderHelper.setGrayEffect(showNode, grayValue)
|
if (showNode) ShaderHelper.setGrayEffect(showNode, grayValue)
|
||||||
}, 1)
|
}, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置图片老化
|
* 设置图片老化
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param grayLevel
|
* @param grayLevel
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setOldPhotoEffect(
|
public static setOldPhotoEffect(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
grayLevel: number = 1,
|
grayLevel: number = 1,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).oldPhoto,
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).oldPhoto,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('oldLevel', grayLevel)
|
material.setProperty('oldLevel', grayLevel)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('oldLevel', grayLevel)
|
material.setProperty('oldLevel', grayLevel)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 播放变灰过程动画
|
* 播放变灰过程动画
|
||||||
*/
|
*/
|
||||||
public static showOldPhotoMv(showNode: Node) {
|
public static showOldPhotoMv(showNode: Node) {
|
||||||
let grayValue: number = 0
|
let grayValue: number = 0
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
grayValue += 0.01
|
grayValue += 0.01
|
||||||
if (grayValue >= 1) {
|
if (grayValue >= 1) {
|
||||||
grayValue = 1
|
grayValue = 1
|
||||||
clearInterval(intervalId)
|
clearInterval(intervalId)
|
||||||
}
|
}
|
||||||
if (showNode) ShaderHelper.setOldPhotoEffect(showNode, grayValue)
|
if (showNode) ShaderHelper.setOldPhotoEffect(showNode, grayValue)
|
||||||
}, 1)
|
}, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加内发光特效
|
* 增加内发光特效
|
||||||
* showNode:要增加特效的节点或者他的子节点
|
* showNode:要增加特效的节点或者他的子节点
|
||||||
* material:发光特效材质
|
* material:发光特效材质
|
||||||
* materialParam: {}
|
* materialParam: {}
|
||||||
* materialParam.glowColor:cc.v4(r,g,b,a) 颜色rbga值的结构体
|
* materialParam.glowColor:cc.v4(r,g,b,a) 颜色rbga值的结构体
|
||||||
* materialParam.glowColorSize:这里为约束一下值发光宽度值在 [0.0, 0.1] 因为 0.1+ 之后的效果可能不明显,也可以自己尝试修改,个人测试感觉0.01效果最佳
|
* materialParam.glowColorSize:这里为约束一下值发光宽度值在 [0.0, 0.1] 因为 0.1+ 之后的效果可能不明显,也可以自己尝试修改,个人测试感觉0.01效果最佳
|
||||||
* materialParam.glowThreshold:这里为约束一下值发光阈值值在 [0.0, 0.5] 因为 0.5+ 之后的效果可能就是其他效果,个人感觉0.1效果最佳
|
* materialParam.glowThreshold:这里为约束一下值发光阈值值在 [0.0, 0.5] 因为 0.5+ 之后的效果可能就是其他效果,个人感觉0.1效果最佳
|
||||||
*/
|
*/
|
||||||
public static setGlowInner(
|
public static setGlowInner(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
materialParam: any,
|
materialParam: any,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).glowInner,
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).glowInner,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('glowColor', materialParam.glowColor)
|
material.setProperty('glowColor', materialParam.glowColor)
|
||||||
material.setProperty('glowColorSize', materialParam.glowColorSize)
|
material.setProperty('glowColorSize', materialParam.glowColorSize)
|
||||||
material.setProperty('glowThreshold', materialParam.glowThreshold)
|
material.setProperty('glowThreshold', materialParam.glowThreshold)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('glowColor', materialParam.glowColor)
|
material.setProperty('glowColor', materialParam.glowColor)
|
||||||
material.setProperty('glowColorSize', materialParam.glowColorSize)
|
material.setProperty('glowColorSize', materialParam.glowColorSize)
|
||||||
material.setProperty('glowThreshold', materialParam.glowThreshold)
|
material.setProperty('glowThreshold', materialParam.glowThreshold)
|
||||||
renderComponent.setMaterial(material, 0)
|
renderComponent.setMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置不同颜色的发光
|
* 设置不同颜色的发光
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param color
|
* @param color
|
||||||
*/
|
*/
|
||||||
public static setCommonGlowInner(showNode: Node, color: Color = Color.WHITE) {
|
public static setCommonGlowInner(showNode: Node, color: Color = Color.WHITE) {
|
||||||
this.setGlowInner(showNode, {
|
this.setGlowInner(showNode, {
|
||||||
glowColor: color,
|
glowColor: color,
|
||||||
glowColorSize: 0.015,
|
glowColorSize: 0.015,
|
||||||
glowThreshold: 0.1,
|
glowThreshold: 0.1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 播放被攻击闪烁过程动画
|
* 播放被攻击闪烁过程动画
|
||||||
*/
|
*/
|
||||||
public static showFlash(showNode: Node, totalFlashTimes: number = 1) {
|
public static showFlash(showNode: Node, totalFlashTimes: number = 1) {
|
||||||
let timeCount: number = 0
|
let timeCount: number = 0
|
||||||
const color: Color = Color.WHITE
|
const color: Color = Color.WHITE
|
||||||
let flashTimes: number = 0
|
let flashTimes: number = 0
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
timeCount += 1
|
timeCount += 1
|
||||||
if (timeCount % 50 === 0) {
|
if (timeCount % 50 === 0) {
|
||||||
const tempCount: number = timeCount / 50
|
const tempCount: number = timeCount / 50
|
||||||
if (tempCount % 2 === 0) {
|
if (tempCount % 2 === 0) {
|
||||||
color.a = 100
|
color.a = 100
|
||||||
this.setGlowInner(showNode, {
|
this.setGlowInner(showNode, {
|
||||||
glowColor: color,
|
glowColor: color,
|
||||||
glowColorSize: 0.1,
|
glowColorSize: 0.1,
|
||||||
glowThreshold: 0,
|
glowThreshold: 0,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
flashTimes++
|
flashTimes++
|
||||||
this.setGlowInner(showNode, {
|
this.setGlowInner(showNode, {
|
||||||
glowColor: color,
|
glowColor: color,
|
||||||
glowColorSize: 0,
|
glowColorSize: 0,
|
||||||
glowThreshold: 0,
|
glowThreshold: 0,
|
||||||
})
|
})
|
||||||
if (flashTimes > totalFlashTimes) clearInterval(intervalId)
|
if (flashTimes > totalFlashTimes) clearInterval(intervalId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1)
|
}, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 马赛克
|
* 马赛克
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param materialParam
|
* @param materialParam
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setMosaic(
|
public static setMosaic(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
materialParam: any,
|
materialParam: any,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).mosaic,
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).mosaic,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('xBlockCount', materialParam.xBlockCount)
|
material.setProperty('xBlockCount', materialParam.xBlockCount)
|
||||||
material.setProperty('yBlockCount', materialParam.yBlockCount)
|
material.setProperty('yBlockCount', materialParam.yBlockCount)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
material.setProperty('xBlockCount', materialParam.xBlockCount)
|
material.setProperty('xBlockCount', materialParam.xBlockCount)
|
||||||
material.setProperty('yBlockCount', materialParam.yBlockCount)
|
material.setProperty('yBlockCount', materialParam.yBlockCount)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 播放被攻击闪烁过程动画
|
* 播放被攻击闪烁过程动画
|
||||||
*/
|
*/
|
||||||
public static showMosaicMv(showNode: Node, callback: Function = null) {
|
public static showMosaicMv(showNode: Node, callback: Function = null) {
|
||||||
let masaicTimes: number = 500
|
let masaicTimes: number = 500
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
masaicTimes -= 2
|
masaicTimes -= 2
|
||||||
this.setMosaic(showNode, {
|
this.setMosaic(showNode, {
|
||||||
xBlockCount: masaicTimes,
|
xBlockCount: masaicTimes,
|
||||||
yBlockCount: masaicTimes,
|
yBlockCount: masaicTimes,
|
||||||
})
|
})
|
||||||
if (masaicTimes <= 30) {
|
if (masaicTimes <= 30) {
|
||||||
clearInterval(intervalId)
|
clearInterval(intervalId)
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
}
|
}
|
||||||
}, 1)
|
}, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置圆角剪切
|
* 设置圆角剪切
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param roundCornerRadius
|
* @param roundCornerRadius
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setRoundCornerCrop(
|
public static setRoundCornerCrop(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
roundCornerRadius: number = 0.1,
|
roundCornerRadius: number = 0.1,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab)
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab)
|
||||||
.roundCornerCrop,
|
.roundCornerCrop,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
// material.setProperty("roundCornerRadius", roundCornerRadius);
|
// material.setProperty("roundCornerRadius", roundCornerRadius);
|
||||||
material.setProperty('xRadius', roundCornerRadius)
|
material.setProperty('xRadius', roundCornerRadius)
|
||||||
material.setProperty('yRadius', roundCornerRadius)
|
material.setProperty('yRadius', roundCornerRadius)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
// material.setProperty("roundCornerRadius", roundCornerRadius);
|
// material.setProperty("roundCornerRadius", roundCornerRadius);
|
||||||
material.setProperty('xRadius', roundCornerRadius)
|
material.setProperty('xRadius', roundCornerRadius)
|
||||||
material.setProperty('yRadius', roundCornerRadius)
|
material.setProperty('yRadius', roundCornerRadius)
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置闪光
|
* 设置闪光
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param lightColor 光颜色
|
* @param lightColor 光颜色
|
||||||
* @param lightWidth 光的宽度
|
* @param lightWidth 光的宽度
|
||||||
* @param lightAngle 光的角度
|
* @param lightAngle 光的角度
|
||||||
* @param enableGradient
|
* @param enableGradient
|
||||||
* @param cropAlpha
|
* @param cropAlpha
|
||||||
* @param enableFog
|
* @param enableFog
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setFlashLight(
|
public static setFlashLight(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
lightColor: Color,
|
lightColor: Color,
|
||||||
lightWidth: number,
|
lightWidth: number,
|
||||||
lightAngle: number = 0,
|
lightAngle: number = 0,
|
||||||
enableGradient: boolean = true,
|
enableGradient: boolean = true,
|
||||||
cropAlpha: boolean = true,
|
cropAlpha: boolean = true,
|
||||||
enableFog: boolean = false,
|
enableFog: boolean = false,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab)
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab)
|
||||||
.flashLight,
|
.flashLight,
|
||||||
) {
|
) {
|
||||||
// showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
// showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
// material.setProperty('lightColor', lightColor)
|
// material.setProperty('lightColor', lightColor)
|
||||||
// material.setProperty('lightWidth', lightWidth)
|
// material.setProperty('lightWidth', lightWidth)
|
||||||
// material.setProperty('lightAngle', lightAngle)
|
// material.setProperty('lightAngle', lightAngle)
|
||||||
// material.setProperty('enableGradient', enableGradient ? 1 : 0)
|
// material.setProperty('enableGradient', enableGradient ? 1 : 0)
|
||||||
// material.setProperty('cropAlpha', cropAlpha ? 1 : 0)
|
// material.setProperty('cropAlpha', cropAlpha ? 1 : 0)
|
||||||
// material.setProperty('enableFog', enableFog ? 1 : 0)
|
// material.setProperty('enableFog', enableFog ? 1 : 0)
|
||||||
// renderComponent.setSharedMaterial(material, 0)
|
// renderComponent.setSharedMaterial(material, 0)
|
||||||
// })
|
// })
|
||||||
// showNode.children.forEach((childNode) => {
|
// showNode.children.forEach((childNode) => {
|
||||||
// childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
// childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
// material.setProperty('lightColor', lightColor)
|
// material.setProperty('lightColor', lightColor)
|
||||||
// material.setProperty('lightWidth', lightWidth)
|
// material.setProperty('lightWidth', lightWidth)
|
||||||
// material.setProperty('lightAngle', lightAngle)
|
// material.setProperty('lightAngle', lightAngle)
|
||||||
// material.setProperty('enableGradient', enableGradient ? 1 : 0)
|
// material.setProperty('enableGradient', enableGradient ? 1 : 0)
|
||||||
// material.setProperty('cropAlpha', cropAlpha ? 1 : 0)
|
// material.setProperty('cropAlpha', cropAlpha ? 1 : 0)
|
||||||
// material.setProperty('enableFog', enableFog ? 1 : 0)
|
// material.setProperty('enableFog', enableFog ? 1 : 0)
|
||||||
// renderComponent.setSharedMaterial(material, 0)
|
// renderComponent.setSharedMaterial(material, 0)
|
||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
const setMaterialProperties = (renderer: UIRenderer) => {
|
const setMaterialProperties = (renderer: UIRenderer) => {
|
||||||
try {
|
try {
|
||||||
material.setProperty('lightColor', lightColor)
|
material.setProperty('lightColor', lightColor)
|
||||||
material.setProperty('lightWidth', lightWidth)
|
material.setProperty('lightWidth', lightWidth)
|
||||||
material.setProperty('lightAngle', lightAngle)
|
material.setProperty('lightAngle', lightAngle)
|
||||||
material.setProperty('enableGradient', enableGradient ? 1 : 0)
|
material.setProperty('enableGradient', enableGradient ? 1 : 0)
|
||||||
material.setProperty('cropAlpha', cropAlpha ? 1 : 0)
|
material.setProperty('cropAlpha', cropAlpha ? 1 : 0)
|
||||||
material.setProperty('enableFog', enableFog ? 1 : 0)
|
material.setProperty('enableFog', enableFog ? 1 : 0)
|
||||||
renderer.setSharedMaterial(material, 0)
|
renderer.setSharedMaterial(material, 0)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error setting material properties:', error)
|
console.error('Error setting material properties:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const renderComponents = [
|
const renderComponents = [
|
||||||
...showNode.getComponents(UIRenderer),
|
...showNode.getComponents(UIRenderer),
|
||||||
...showNode.children.flatMap(childNode => childNode.getComponents(UIRenderer)),
|
...showNode.children.flatMap(childNode => childNode.getComponents(UIRenderer)),
|
||||||
]
|
]
|
||||||
|
|
||||||
renderComponents.forEach((renderComponent: UIRenderer) => {
|
renderComponents.forEach((renderComponent: UIRenderer) => {
|
||||||
setMaterialProperties(renderComponent)
|
setMaterialProperties(renderComponent)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 玩家升级shader动画
|
* 玩家升级shader动画
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static showFlashLightMv(showNode: Node, callback: Function = null) {
|
public static showFlashLightMv(showNode: Node, callback: Function = null) {
|
||||||
const nowClor: Color = new Color(0, 0, 0, 255)
|
const nowClor: Color = new Color(0, 0, 0, 255)
|
||||||
let colorIndex: number = 0
|
let colorIndex: number = 0
|
||||||
let lightAngle: number = 0
|
let lightAngle: number = 0
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
if (colorIndex === 0) {
|
if (colorIndex === 0) {
|
||||||
nowClor.r = nowClor.r + 2
|
nowClor.r = nowClor.r + 2
|
||||||
if (nowClor.r >= 255) colorIndex += 1
|
if (nowClor.r >= 255) colorIndex += 1
|
||||||
} else if (colorIndex === 1) {
|
} else if (colorIndex === 1) {
|
||||||
nowClor.g = nowClor.g + 2
|
nowClor.g = nowClor.g + 2
|
||||||
if (nowClor.g >= 255) colorIndex += 1
|
if (nowClor.g >= 255) colorIndex += 1
|
||||||
} else {
|
} else {
|
||||||
nowClor.b = nowClor.b + 2
|
nowClor.b = nowClor.b + 2
|
||||||
if (nowClor.b >= 255) {
|
if (nowClor.b >= 255) {
|
||||||
clearInterval(intervalId)
|
clearInterval(intervalId)
|
||||||
ShaderHelper.clearAllEffect(showNode)
|
ShaderHelper.clearAllEffect(showNode)
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lightAngle += 1
|
lightAngle += 1
|
||||||
this.setFlashLight(showNode, nowClor, 1, lightAngle)
|
this.setFlashLight(showNode, nowClor, 1, lightAngle)
|
||||||
}, 1)
|
}, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static setFlag(
|
public static setFlag(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).flag,
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).flag,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置高斯模糊
|
* 设置高斯模糊
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setGaussian(
|
public static setGaussian(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).gaussian,
|
material: Material = ShaderMaterialPrefab.instance.getComponent(ShaderMaterialPrefab).gaussian,
|
||||||
) {
|
) {
|
||||||
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
showNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
const tran = renderComponent.node.getComponent(UITransform)
|
const tran = renderComponent.node.getComponent(UITransform)
|
||||||
material.setProperty('textureSize', new Vec2(tran.contentSize.width, tran.contentSize.height))
|
material.setProperty('textureSize', new Vec2(tran.contentSize.width, tran.contentSize.height))
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
showNode.children.forEach((childNode) => {
|
showNode.children.forEach((childNode) => {
|
||||||
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
childNode.getComponents(UIRenderer).forEach((renderComponent: UIRenderer) => {
|
||||||
const tran = renderComponent.node.getComponent(UITransform)
|
const tran = renderComponent.node.getComponent(UITransform)
|
||||||
material.setProperty(
|
material.setProperty(
|
||||||
'textureSize',
|
'textureSize',
|
||||||
new Vec2(tran.contentSize.width, tran.contentSize.height),
|
new Vec2(tran.contentSize.width, tran.contentSize.height),
|
||||||
)
|
)
|
||||||
// material.setProperty("textureSize", cc.v2(showNode.width, showNode.height));
|
// material.setProperty("textureSize", cc.v2(showNode.width, showNode.height));
|
||||||
renderComponent.setSharedMaterial(material, 0)
|
renderComponent.setSharedMaterial(material, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "347c6bb0-da88-4e18-b261-9298e6dcaa7a",
|
"uuid": "347c6bb0-da88-4e18-b261-9298e6dcaa7a",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,133 +1,133 @@
|
|||||||
import { sys } from 'cc'
|
import { sys } from 'cc'
|
||||||
|
|
||||||
import ManifestConfig from '../config/ManifestConfig'
|
import ManifestConfig from '../config/ManifestConfig'
|
||||||
|
|
||||||
import EventManager from './EventManager'
|
import EventManager from './EventManager'
|
||||||
import HotUpdate from './HotUpdate'
|
import HotUpdate from './HotUpdate'
|
||||||
|
|
||||||
export default class VersionManager {
|
export default class VersionManager {
|
||||||
public static instance: VersionManager = new VersionManager()
|
public static instance: VersionManager = new VersionManager()
|
||||||
|
|
||||||
public static Config_Game_Name: Array<string> = ['游戏大厅']
|
public static Config_Game_Name: Array<string> = ['游戏大厅']
|
||||||
|
|
||||||
// 热更文件下载来后存放文件夹
|
// 热更文件下载来后存放文件夹
|
||||||
public static Config_Key: Array<string> = ['main-remote-asset']
|
public static Config_Key: Array<string> = ['main-remote-asset']
|
||||||
|
|
||||||
private static Config_ManifestName: string = 'project.manifest'
|
private static Config_ManifestName: string = 'project.manifest'
|
||||||
|
|
||||||
public static Config_Url_Key: Array<string> = ['main']
|
public static Config_Url_Key: Array<string> = ['main']
|
||||||
|
|
||||||
public iosStoreUrl: string = ''
|
public iosStoreUrl: string = ''
|
||||||
public apkStoreUrl: string = ''
|
public apkStoreUrl: string = ''
|
||||||
|
|
||||||
public nowVersion: string = ManifestConfig.version // 网页显示版本号,如果是热更会替换改值
|
public nowVersion: string = ManifestConfig.version // 网页显示版本号,如果是热更会替换改值
|
||||||
public targetVersion: string = '1.0.0'
|
public targetVersion: string = '1.0.0'
|
||||||
|
|
||||||
public isOpenHotUpdate: boolean = true // 是否打开热更
|
public isOpenHotUpdate: boolean = true // 是否打开热更
|
||||||
|
|
||||||
private hotUpdateList: Array<HotUpdate> = []
|
private hotUpdateList: Array<HotUpdate> = []
|
||||||
|
|
||||||
private noUpdateIndex: number = -1 //
|
private noUpdateIndex: number = -1 //
|
||||||
|
|
||||||
public init() {
|
public init() {
|
||||||
this.reInitAll()
|
this.reInitAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
public reInitAll() {
|
public reInitAll() {
|
||||||
this.releaseAll()
|
this.releaseAll()
|
||||||
for (let i = 0; i < VersionManager.Config_Key.length; i++) this.reInit(i)
|
for (let i = 0; i < VersionManager.Config_Key.length; i++) this.reInit(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
public releaseAll() {
|
public releaseAll() {
|
||||||
for (let i = 0; i < VersionManager.Config_Key.length; i++)
|
for (let i = 0; i < VersionManager.Config_Key.length; i++)
|
||||||
if (this.hotUpdateList[i]) this.hotUpdateList[i].disposeUpdate()
|
if (this.hotUpdateList[i]) this.hotUpdateList[i].disposeUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
public reInit(index: number) {
|
public reInit(index: number) {
|
||||||
if (!this.hotUpdateList[index]) this.hotUpdateList[index] = new HotUpdate()
|
if (!this.hotUpdateList[index]) this.hotUpdateList[index] = new HotUpdate()
|
||||||
|
|
||||||
this.hotUpdateList[index].init(
|
this.hotUpdateList[index].init(
|
||||||
index,
|
index,
|
||||||
VersionManager.Config_Key[index],
|
VersionManager.Config_Key[index],
|
||||||
VersionManager.Config_ManifestName,
|
VersionManager.Config_ManifestName,
|
||||||
)
|
)
|
||||||
if (!this.isOpenHotUpdate) {
|
if (!this.isOpenHotUpdate) {
|
||||||
this.hotUpdateList[index].isCheck = true
|
this.hotUpdateList[index].isCheck = true
|
||||||
this.hotUpdateList[index].isFinishUpdate = true
|
this.hotUpdateList[index].isFinishUpdate = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public checkUpdate(keyIndex: number) {
|
public checkUpdate(keyIndex: number) {
|
||||||
if (keyIndex < this.hotUpdateList.length) {
|
if (keyIndex < this.hotUpdateList.length) {
|
||||||
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
||||||
if (sys.isNative) {
|
if (sys.isNative) {
|
||||||
if (keyIndex === this.noUpdateIndex) {
|
if (keyIndex === this.noUpdateIndex) {
|
||||||
// 在大厅热更,不用子游戏热更了
|
// 在大厅热更,不用子游戏热更了
|
||||||
hotUpdate.isCheck = true
|
hotUpdate.isCheck = true
|
||||||
hotUpdate.isFinishUpdate = true
|
hotUpdate.isFinishUpdate = true
|
||||||
EventManager.instance.dispatchEvent(
|
EventManager.instance.dispatchEvent(
|
||||||
HotUpdate.Event_On_ALREADY_UP_TO_DATE,
|
HotUpdate.Event_On_ALREADY_UP_TO_DATE,
|
||||||
VersionManager.Config_Key[keyIndex],
|
VersionManager.Config_Key[keyIndex],
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
hotUpdate.checkUpdate()
|
hotUpdate.checkUpdate()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hotUpdate.isCheck = true
|
hotUpdate.isCheck = true
|
||||||
hotUpdate.isFinishUpdate = true
|
hotUpdate.isFinishUpdate = true
|
||||||
EventManager.instance.dispatchEvent(
|
EventManager.instance.dispatchEvent(
|
||||||
HotUpdate.Event_On_ALREADY_UP_TO_DATE,
|
HotUpdate.Event_On_ALREADY_UP_TO_DATE,
|
||||||
VersionManager.Config_Key[keyIndex],
|
VersionManager.Config_Key[keyIndex],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EventManager.instance.dispatchEvent(
|
EventManager.instance.dispatchEvent(
|
||||||
HotUpdate.Event_On_ALREADY_UP_TO_DATE,
|
HotUpdate.Event_On_ALREADY_UP_TO_DATE,
|
||||||
VersionManager.Config_Key[keyIndex],
|
VersionManager.Config_Key[keyIndex],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public startUpdate(keyIndex: number) {
|
public startUpdate(keyIndex: number) {
|
||||||
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
||||||
hotUpdate.startUpdate()
|
hotUpdate.startUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
public isCheck(keyIndex: number) {
|
public isCheck(keyIndex: number) {
|
||||||
if (keyIndex < this.hotUpdateList.length) {
|
if (keyIndex < this.hotUpdateList.length) {
|
||||||
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
||||||
if (keyIndex === this.noUpdateIndex) return true
|
if (keyIndex === this.noUpdateIndex) return true
|
||||||
|
|
||||||
return hotUpdate.isCheck
|
return hotUpdate.isCheck
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
public needUpdate(keyIndex: number) {
|
public needUpdate(keyIndex: number) {
|
||||||
if (keyIndex < this.hotUpdateList.length) {
|
if (keyIndex < this.hotUpdateList.length) {
|
||||||
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
||||||
if (keyIndex === this.noUpdateIndex) return false
|
if (keyIndex === this.noUpdateIndex) return false
|
||||||
|
|
||||||
return hotUpdate.needUpdate
|
return hotUpdate.needUpdate
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
public isUpdating(keyIndex: number) {
|
public isUpdating(keyIndex: number) {
|
||||||
if (keyIndex < this.hotUpdateList.length) {
|
if (keyIndex < this.hotUpdateList.length) {
|
||||||
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
||||||
return hotUpdate.isUpdating
|
return hotUpdate.isUpdating
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
public isFinishUpdate(keyIndex: number) {
|
public isFinishUpdate(keyIndex: number) {
|
||||||
if (keyIndex < this.hotUpdateList.length) {
|
if (keyIndex < this.hotUpdateList.length) {
|
||||||
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
const hotUpdate: HotUpdate = this.hotUpdateList[keyIndex]
|
||||||
if (keyIndex === this.noUpdateIndex) return true
|
if (keyIndex === this.noUpdateIndex) return true
|
||||||
|
|
||||||
return hotUpdate.isFinishUpdate
|
return hotUpdate.isFinishUpdate
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "c79a6571-dc2f-4715-a5d6-151542eef238",
|
"uuid": "c79a6571-dc2f-4715-a5d6-151542eef238",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "2ac3d2c9-b418-4202-b672-736c533b89ea",
|
"uuid": "2ac3d2c9-b418-4202-b672-736c533b89ea",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"ver": "1.2.0",
|
"ver": "1.2.0",
|
||||||
"importer": "directory",
|
"importer": "directory",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "37ac4184-546f-4fa8-9030-da49dbe4219c",
|
"uuid": "37ac4184-546f-4fa8-9030-da49dbe4219c",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"compressionType": {},
|
"compressionType": {},
|
||||||
"isRemoteBundle": {}
|
"isRemoteBundle": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DEV } from 'cc/env'
|
import { DEV } from 'cc/env'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
url: () => (DEV ? 'https://fish.wanzhuanyongcheng.cn' : 'https://fish.jdt168.com'),
|
url: () => (DEV ? 'https://fish.wanzhuanyongcheng.cn' : 'https://fish.jdt168.com'),
|
||||||
wsUrl: () => (DEV ? 'fish.wanzhuanyongcheng.cn' : 'fish.jdt168.com'),
|
wsUrl: () => (DEV ? 'fish.wanzhuanyongcheng.cn' : 'fish.jdt168.com'),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "f01978bd-5d14-49a6-bea7-4b7ad0c82b7b",
|
"uuid": "f01978bd-5d14-49a6-bea7-4b7ad0c82b7b",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {}
|
"userData": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,86 +1,86 @@
|
|||||||
import { FishInfo } from './FishInfo'
|
import { FishInfo } from './FishInfo'
|
||||||
import config from './Config'
|
import config from './Config'
|
||||||
export class FishConfig {
|
export class FishConfig {
|
||||||
public static config: Array<FishInfo> = [
|
public static config: Array<FishInfo> = [
|
||||||
// new FishInfo(1, '蝴蝶鱼', 2, 2),
|
// new FishInfo(1, '蝴蝶鱼', 2, 2),
|
||||||
// new FishInfo(2, '鲶鱼', 2, 1),
|
// new FishInfo(2, '鲶鱼', 2, 1),
|
||||||
// new FishInfo(3, '狮子鱼', 2, 2),
|
// new FishInfo(3, '狮子鱼', 2, 2),
|
||||||
// new FishInfo(4, '条纹鱼', 2, 2),
|
// new FishInfo(4, '条纹鱼', 2, 2),
|
||||||
// new FishInfo(5, '沙丁鱼', 2, 2),
|
// new FishInfo(5, '沙丁鱼', 2, 2),
|
||||||
// new FishInfo(6, '石斑鱼', 2, 2),
|
// new FishInfo(6, '石斑鱼', 2, 2),
|
||||||
// new FishInfo(7, '河豚', 3, 1.2),
|
// new FishInfo(7, '河豚', 3, 1.2),
|
||||||
// new FishInfo(8, '海螺', 3, 2),
|
// new FishInfo(8, '海螺', 3, 2),
|
||||||
// new FishInfo(9, '接吻鱼', 3, 1.2),
|
// new FishInfo(9, '接吻鱼', 3, 1.2),
|
||||||
// new FishInfo(10, '海姆', 4, 1),
|
// new FishInfo(10, '海姆', 4, 1),
|
||||||
// new FishInfo(11, '绿鳍鱼', 4, 1.2),
|
// new FishInfo(11, '绿鳍鱼', 4, 1.2),
|
||||||
// new FishInfo(12, '鲎', 4, 1.2),
|
// new FishInfo(12, '鲎', 4, 1.2),
|
||||||
// new FishInfo(13, '魔鬼鱼', 5, 0.6),
|
// new FishInfo(13, '魔鬼鱼', 5, 0.6),
|
||||||
// new FishInfo(14, '小海龟', 5, 2),
|
// new FishInfo(14, '小海龟', 5, 2),
|
||||||
// new FishInfo(15, '锤头鲨', 6, 0.5),
|
// new FishInfo(15, '锤头鲨', 6, 0.5),
|
||||||
// new FishInfo(16, '金枪鱼', 6, 0.5),
|
// new FishInfo(16, '金枪鱼', 6, 0.5),
|
||||||
// new FishInfo(17, '大三元', 6, 0.5),
|
// new FishInfo(17, '大三元', 6, 0.5),
|
||||||
// new FishInfo(18, '黄金鲎', 6, 1.2),
|
// new FishInfo(18, '黄金鲎', 6, 1.2),
|
||||||
// new FishInfo(19, '大四喜', 7, 0.5),
|
// new FishInfo(19, '大四喜', 7, 0.5),
|
||||||
// new FishInfo(20, '黄金锤头鲨', 7, 0.5),
|
// new FishInfo(20, '黄金锤头鲨', 7, 0.5),
|
||||||
// new FishInfo(21, '金海姆', 7, 0.6),
|
// new FishInfo(21, '金海姆', 7, 0.6),
|
||||||
// new FishInfo(22, '五福临门', 8, 0.4),
|
// new FishInfo(22, '五福临门', 8, 0.4),
|
||||||
// new FishInfo(23, '金海龟', 8, 0.7),
|
// new FishInfo(23, '金海龟', 8, 0.7),
|
||||||
// new FishInfo(24, '金鲨', 8, 0.5),
|
// new FishInfo(24, '金鲨', 8, 0.5),
|
||||||
// new FishInfo(25, '蓝鲨', 8, 0.5),
|
// new FishInfo(25, '蓝鲨', 8, 0.5),
|
||||||
// new FishInfo(26, '美人鱼', 14, 0.4),
|
// new FishInfo(26, '美人鱼', 14, 0.4),
|
||||||
// new FishInfo(27, '金龙', 14, 0.3),
|
// new FishInfo(27, '金龙', 14, 0.3),
|
||||||
// new FishInfo(28, '章鱼', 10, 0.5),
|
// new FishInfo(28, '章鱼', 10, 0.5),
|
||||||
// new FishInfo(29, '电鳗鱼', 3, 0.8),
|
// new FishInfo(29, '电鳗鱼', 3, 0.8),
|
||||||
// new FishInfo(1, '蝴蝶鱼'),
|
// new FishInfo(1, '蝴蝶鱼'),
|
||||||
// new FishInfo(2, '鲶鱼'),
|
// new FishInfo(2, '鲶鱼'),
|
||||||
// new FishInfo(3, '狮子鱼'),
|
// new FishInfo(3, '狮子鱼'),
|
||||||
// new FishInfo(4, '条纹鱼'),
|
// new FishInfo(4, '条纹鱼'),
|
||||||
// new FishInfo(5, '沙丁鱼'),
|
// new FishInfo(5, '沙丁鱼'),
|
||||||
// new FishInfo(6, '石斑鱼'),
|
// new FishInfo(6, '石斑鱼'),
|
||||||
// new FishInfo(7, '河豚'),
|
// new FishInfo(7, '河豚'),
|
||||||
// new FishInfo(8, '海螺'),
|
// new FishInfo(8, '海螺'),
|
||||||
// new FishInfo(9, '接吻鱼'),
|
// new FishInfo(9, '接吻鱼'),
|
||||||
// new FishInfo(10, '海姆'),
|
// new FishInfo(10, '海姆'),
|
||||||
// new FishInfo(11, '绿鳍鱼'),
|
// new FishInfo(11, '绿鳍鱼'),
|
||||||
// new FishInfo(12, '鲎'),
|
// new FishInfo(12, '鲎'),
|
||||||
// new FishInfo(13, '魔鬼鱼'),
|
// new FishInfo(13, '魔鬼鱼'),
|
||||||
// new FishInfo(14, '小海龟'),
|
// new FishInfo(14, '小海龟'),
|
||||||
// new FishInfo(15, '锤头鲨'),
|
// new FishInfo(15, '锤头鲨'),
|
||||||
// new FishInfo(16, '金枪鱼'),
|
// new FishInfo(16, '金枪鱼'),
|
||||||
// new FishInfo(17, '大三元'),
|
// new FishInfo(17, '大三元'),
|
||||||
// new FishInfo(18, '黄金鲎'),
|
// new FishInfo(18, '黄金鲎'),
|
||||||
// new FishInfo(19, '大四喜'),
|
// new FishInfo(19, '大四喜'),
|
||||||
// new FishInfo(20, '黄金锤头鲨'),
|
// new FishInfo(20, '黄金锤头鲨'),
|
||||||
// new FishInfo(21, '金海姆'),
|
// new FishInfo(21, '金海姆'),
|
||||||
// new FishInfo(22, '五福临门'),
|
// new FishInfo(22, '五福临门'),
|
||||||
// new FishInfo(23, '金海龟'),
|
// new FishInfo(23, '金海龟'),
|
||||||
// new FishInfo(24, '金鲨'),
|
// new FishInfo(24, '金鲨'),
|
||||||
// new FishInfo(25, '蓝鲨'),
|
// new FishInfo(25, '蓝鲨'),
|
||||||
// new FishInfo(26, '美人鱼'),
|
// new FishInfo(26, '美人鱼'),
|
||||||
// new FishInfo(27, '金龙'),
|
// new FishInfo(27, '金龙'),
|
||||||
// new FishInfo(28, '章鱼'),
|
// new FishInfo(28, '章鱼'),
|
||||||
// new FishInfo(29, '电鳗鱼'),
|
// new FishInfo(29, '电鳗鱼'),
|
||||||
]
|
]
|
||||||
|
|
||||||
public static async init() {
|
public static async init() {
|
||||||
this.config = []
|
this.config = []
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
fetch(`${config.url()}/fish/list`)
|
fetch(`${config.url()}/fish/list`)
|
||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const { data: res } = JSON.parse(response)
|
const { data: res } = JSON.parse(response)
|
||||||
res.data.forEach((item) => {
|
res.data.forEach((item) => {
|
||||||
this.config.push(new FishInfo(item.ID, item.name, item.health))
|
this.config.push(new FishInfo(item.ID, item.name, item.health))
|
||||||
})
|
})
|
||||||
resolve(true)
|
resolve(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getFishInfoByType(fishType: number) {
|
public static getFishInfoByType(fishType: number) {
|
||||||
for (let i = 0; i < this.config.length; i++) {
|
for (let i = 0; i < this.config.length; i++) {
|
||||||
const fishInfo: FishInfo = this.config[i]
|
const fishInfo: FishInfo = this.config[i]
|
||||||
if (fishInfo.fishType === fishType) return fishInfo
|
if (fishInfo.fishType === fishType) return fishInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "c7516237-7eb2-4767-8cc7-7ce0b2d5484e",
|
"uuid": "c7516237-7eb2-4767-8cc7-7ce0b2d5484e",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
export class FishInfo {
|
export class FishInfo {
|
||||||
public fishType: number
|
public fishType: number
|
||||||
public name: string
|
public name: string
|
||||||
public blood: number
|
public blood: number
|
||||||
// public wikiScale: number
|
// public wikiScale: number
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
fishType: number,
|
fishType: number,
|
||||||
name: string,
|
name: string,
|
||||||
blood: number,
|
blood: number,
|
||||||
// wikiScale: number,
|
// wikiScale: number,
|
||||||
) {
|
) {
|
||||||
this.fishType = fishType
|
this.fishType = fishType
|
||||||
this.name = name
|
this.name = name
|
||||||
this.blood = blood
|
this.blood = blood
|
||||||
// this.wikiScale = wikiScale
|
// this.wikiScale = wikiScale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "03f14923-6d67-4d91-97ad-a81bf4f1551f",
|
"uuid": "03f14923-6d67-4d91-97ad-a81bf4f1551f",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { FishMapInfo } from './FishMapInfo'
|
import { FishMapInfo } from './FishMapInfo'
|
||||||
|
|
||||||
export class FishMap {
|
export class FishMap {
|
||||||
public mapId: number
|
public mapId: number
|
||||||
public fishMapInfoList: Array<FishMapInfo>
|
public fishMapInfoList: Array<FishMapInfo>
|
||||||
|
|
||||||
constructor(mapId: number, list: Array<FishMapInfo>) {
|
constructor(mapId: number, list: Array<FishMapInfo>) {
|
||||||
this.mapId = mapId
|
this.mapId = mapId
|
||||||
this.fishMapInfoList = list
|
this.fishMapInfoList = list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "f84ce3e3-8c47-43ff-a6f4-7cda4c320fcf",
|
"uuid": "f84ce3e3-8c47-43ff-a6f4-7cda4c320fcf",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
export class FishMapInfo {
|
export class FishMapInfo {
|
||||||
public fishType: number
|
public fishType: number
|
||||||
public scale: number
|
public scale: number
|
||||||
public side: number // 1: -1:
|
public side: number // 1: -1:
|
||||||
public x: number
|
public x: number
|
||||||
public y: number
|
public y: number
|
||||||
|
|
||||||
constructor(fishType: number, scale: number, side: number, x: number, y: number) {
|
constructor(fishType: number, scale: number, side: number, x: number, y: number) {
|
||||||
this.fishType = fishType
|
this.fishType = fishType
|
||||||
this.scale = scale
|
this.scale = scale
|
||||||
this.side = side
|
this.side = side
|
||||||
this.x = x
|
this.x = x
|
||||||
this.y = y
|
this.y = y
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"ver": "4.0.23",
|
"ver": "4.0.23",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "5f3df30a-4677-4f9c-97a9-e80fcb5b8295",
|
"uuid": "5f3df30a-4677-4f9c-97a9-e80fcb5b8295",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"simulateGlobals": []
|
"simulateGlobals": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user