feat: 提交资源

This commit is contained in:
han_han9
2025-10-28 21:55:41 +08:00
parent 591f398085
commit 55c4fcd9ae
2146 changed files with 172747 additions and 456 deletions

9
assets/games/atlas.meta Normal file
View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "36f0951d-0b77-4728-bebc-c8192f0c8185",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "1f979c16-7cc3-4786-b607-b82b0591dcc9",
"files": [],
"subMetas": {},
"userData": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "a562f181-3b53-4777-802d-5dce3b1cac21",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "a562f181-3b53-4777-802d-5dce3b1cac21@6c48a",
"displayName": "Icon_Reward_Pass_ax",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "a562f181-3b53-4777-802d-5dce3b1cac21",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "a562f181-3b53-4777-802d-5dce3b1cac21@f9941",
"displayName": "Icon_Reward_Pass_ax",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 216,
"height": 211,
"rawWidth": 216,
"rawHeight": 211,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-108,
-105.5,
0,
108,
-105.5,
0,
-108,
105.5,
0,
108,
105.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
211,
216,
211,
0,
0,
216,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-108,
-105.5,
0
],
"maxPos": [
108,
105.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "a562f181-3b53-4777-802d-5dce3b1cac21@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "a562f181-3b53-4777-802d-5dce3b1cac21@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "fb18880a-860d-4b65-a202-b5f628d89b13",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "fb18880a-860d-4b65-a202-b5f628d89b13@6c48a",
"displayName": "Icon_Reward_Pass_book",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "fb18880a-860d-4b65-a202-b5f628d89b13",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "fb18880a-860d-4b65-a202-b5f628d89b13@f9941",
"displayName": "Icon_Reward_Pass_book",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 215,
"height": 209,
"rawWidth": 215,
"rawHeight": 209,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-107.5,
-104.5,
0,
107.5,
-104.5,
0,
-107.5,
104.5,
0,
107.5,
104.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
209,
215,
209,
0,
0,
215,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-107.5,
-104.5,
0
],
"maxPos": [
107.5,
104.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "fb18880a-860d-4b65-a202-b5f628d89b13@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "fb18880a-860d-4b65-a202-b5f628d89b13@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "ccee92f9-8e71-4d88-b335-48eb76c53172",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "ccee92f9-8e71-4d88-b335-48eb76c53172@6c48a",
"displayName": "Icon_Reward_Pass_clover",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "ccee92f9-8e71-4d88-b335-48eb76c53172",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "ccee92f9-8e71-4d88-b335-48eb76c53172@f9941",
"displayName": "Icon_Reward_Pass_clover",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 191,
"height": 210,
"rawWidth": 191,
"rawHeight": 210,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-95.5,
-105,
0,
95.5,
-105,
0,
-95.5,
105,
0,
95.5,
105,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
210,
191,
210,
0,
0,
191,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-95.5,
-105,
0
],
"maxPos": [
95.5,
105,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "ccee92f9-8e71-4d88-b335-48eb76c53172@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "ccee92f9-8e71-4d88-b335-48eb76c53172@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "7691c8f3-3ca8-4a3b-882a-dfc7b2402ef7",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "7691c8f3-3ca8-4a3b-882a-dfc7b2402ef7@6c48a",
"displayName": "Icon_Reward_Pass_gem",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "7691c8f3-3ca8-4a3b-882a-dfc7b2402ef7",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "7691c8f3-3ca8-4a3b-882a-dfc7b2402ef7@f9941",
"displayName": "Icon_Reward_Pass_gem",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 247,
"height": 196,
"rawWidth": 247,
"rawHeight": 196,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-123.5,
-98,
0,
123.5,
-98,
0,
-123.5,
98,
0,
123.5,
98,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
196,
247,
196,
0,
0,
247,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-123.5,
-98,
0
],
"maxPos": [
123.5,
98,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "7691c8f3-3ca8-4a3b-882a-dfc7b2402ef7@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "7691c8f3-3ca8-4a3b-882a-dfc7b2402ef7@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "7c4eee6e-2941-493b-a0ee-772463486f39",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "7c4eee6e-2941-493b-a0ee-772463486f39@6c48a",
"displayName": "Icon_Reward_Pass_glove",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "7c4eee6e-2941-493b-a0ee-772463486f39",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "7c4eee6e-2941-493b-a0ee-772463486f39@f9941",
"displayName": "Icon_Reward_Pass_glove",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 196,
"height": 195,
"rawWidth": 196,
"rawHeight": 195,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-98,
-97.5,
0,
98,
-97.5,
0,
-98,
97.5,
0,
98,
97.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
195,
196,
195,
0,
0,
196,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-98,
-97.5,
0
],
"maxPos": [
98,
97.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "7c4eee6e-2941-493b-a0ee-772463486f39@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "7c4eee6e-2941-493b-a0ee-772463486f39@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "b8625559-dd62-4c66-96aa-abcc7a69f567",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b8625559-dd62-4c66-96aa-abcc7a69f567@6c48a",
"displayName": "Icon_Reward_Pass_gold",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "b8625559-dd62-4c66-96aa-abcc7a69f567",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "b8625559-dd62-4c66-96aa-abcc7a69f567@f9941",
"displayName": "Icon_Reward_Pass_gold",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 256,
"height": 189,
"rawWidth": 256,
"rawHeight": 189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-128,
-94.5,
0,
128,
-94.5,
0,
-128,
94.5,
0,
128,
94.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
189,
256,
189,
0,
0,
256,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-128,
-94.5,
0
],
"maxPos": [
128,
94.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "b8625559-dd62-4c66-96aa-abcc7a69f567@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "b8625559-dd62-4c66-96aa-abcc7a69f567@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "8188705e-b03f-4224-944c-aa443ba8e198",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "8188705e-b03f-4224-944c-aa443ba8e198@6c48a",
"displayName": "Icon_Reward_Pass_rune",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "8188705e-b03f-4224-944c-aa443ba8e198",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "8188705e-b03f-4224-944c-aa443ba8e198@f9941",
"displayName": "Icon_Reward_Pass_rune",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 217,
"height": 213,
"rawWidth": 217,
"rawHeight": 213,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-108.5,
-106.5,
0,
108.5,
-106.5,
0,
-108.5,
106.5,
0,
108.5,
106.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
213,
217,
213,
0,
0,
217,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-108.5,
-106.5,
0
],
"maxPos": [
108.5,
106.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "8188705e-b03f-4224-944c-aa443ba8e198@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "8188705e-b03f-4224-944c-aa443ba8e198@6c48a"
}
}

View File

@@ -0,0 +1,3 @@
{
"__type__": "cc.SpriteAtlas"
}

View File

@@ -0,0 +1,36 @@
{
"ver": "1.0.8",
"importer": "auto-atlas",
"imported": true,
"uuid": "35330028-a50f-4ff1-ba32-5a0e04e3bbf2",
"files": [
".json"
],
"subMetas": {},
"userData": {
"maxWidth": 1024,
"maxHeight": 1024,
"padding": 2,
"allowRotation": true,
"forceSquared": false,
"powerOfTwo": false,
"algorithm": "MaxRects",
"format": "png",
"quality": 80,
"contourBleed": true,
"paddingBleed": true,
"filterUnused": false,
"removeTextureInBundle": false,
"removeImageInBundle": false,
"removeSpriteAtlasInBundle": false,
"compressSettings": {},
"textureSetting": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
}
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "a49f7c60-2ec3-427a-8219-ae3f0886182d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "95d180a6-c186-4180-b0fe-29815b9b8b7c",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "60f72a13-68d6-4351-97aa-e8318e375dda",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "CurrencyContainer"
}
}

View File

@@ -0,0 +1,632 @@
[
{
"__type__": "cc.Prefab",
"_name": "CurrencyItem",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "CurrencyItem",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 8
},
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
}
],
"_prefab": {
"__id__": 26
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "AddBtn",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -47.279998779296875,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 49,
"height": 53
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "a2GgxdOy5KS7fwb8O+MJyL"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "8056567a-7bb5-4d3e-b5f1-df94774d273d@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "9dfTYmKOZASbUwU1XtzELz"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "7epLlueXRLJJ0LsZ991hOv",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "ValueLabel",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 10,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 46.55999755859375,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "09wKAKnbBB+5lZqBGPJIvn"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "20",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 40,
"_fontSize": 40,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": {
"__uuid__": "1e4ba4a2-7090-4e7b-8479-72285e08cdeb",
"__expectedType__": "cc.TTFFont"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": false,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "44zvc167VCRKo7OrwxzXs0"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "1djLQFnGBH/bp9kcIVVJtl",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Icon",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
},
{
"__id__": 17
}
],
"_prefab": {
"__id__": 19
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 75,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_contentSize": {
"__type__": "cc.Size",
"width": 68,
"height": 91
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "61L4FvqltGmJkxCozXtvXb"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "d4766020-e395-41f8-96d1-605e73caecc8@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "67KlomGiZGkoxxMddz6UMZ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "83DdlgppxDqZ9HTy1Ld1x+",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"_contentSize": {
"__type__": "cc.Size",
"width": 163.55999755859375,
"height": 64
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3dtCsSiNNH9I7OHE0LXe8z"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 4,
"g": 33,
"b": 30,
"a": 255
},
"_spriteFrame": {
"__uuid__": "edc626d3-77ee-4880-b707-da79f9dd6d97@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "9a33L6+C1ITahVCBb3AYxx"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 25
},
"_resizeMode": 1,
"_layoutType": 1,
"_cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_startAxis": 0,
"_paddingLeft": 10,
"_paddingRight": -50,
"_paddingTop": 0,
"_paddingBottom": 0,
"_spacingX": 20,
"_spacingY": 0,
"_verticalDirection": 1,
"_horizontalDirection": 0,
"_constraint": 0,
"_constraintNum": 2,
"_affectedByScale": false,
"_isAlign": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d3QJZHxpBK0bRpdCfcnjsv"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "21S4TQDzROJK1npIOgoF+m",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "334b6dda-3905-424e-bea3-5c56d3c51efe",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "CurrencyItem"
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "6e6fdb82-af61-4574-bae8-f29c78b8eb4d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "a2524a27-9d0d-465c-a1bd-01b4229c3ef1",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "b7a6cbd2-b13b-4eb9-9608-3d53c816315a",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "CommonDialogBox"
}
}

View File

@@ -0,0 +1,486 @@
[
{
"__type__": "cc.Prefab",
"_name": "CommonToast",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "CommonToast",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
}
],
"_prefab": {
"__id__": 22
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Container",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
},
{
"__id__": 13
}
],
"_prefab": {
"__id__": 15
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 930,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Content",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 6
}
],
"_prefab": {
"__id__": 8
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -73,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2460,
"height": 66.78
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "78F/C0LzlIZprU8L6fH1uZ"
},
{
"__type__": "cc.RichText",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"_lineHeight": 53,
"_string": "",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_fontSize": 53,
"_fontColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_maxWidth": 2460,
"_fontFamily": "Arial",
"_font": {
"__uuid__": "1e4ba4a2-7090-4e7b-8479-72285e08cdeb",
"__expectedType__": "cc.TTFFont"
},
"_isSystemFontUsed": false,
"_userDefinedFont": {
"__uuid__": "1e4ba4a2-7090-4e7b-8479-72285e08cdeb",
"__expectedType__": "cc.TTFFont"
},
"_cacheMode": 0,
"_imageAtlas": {
"__uuid__": "35330028-a50f-4ff1-ba32-5a0e04e3bbf2",
"__expectedType__": "cc.SpriteAtlas"
},
"_handleTouchEvent": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c309HMP+5FiLw2COQEShKP"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "95YqJo5jVJmKTQCV9sNJ8Q",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2560,
"height": 183
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6bie7ttBVMh60blIUo01g6"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_alignFlags": 40,
"_target": null,
"_left": 0,
"_right": 0,
"_top": -210,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": false,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c8KBjUN7hMC69oIfCgH/Eb"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "536e0b99-f1b2-4e59-ab32-8c4e67fbbf4d@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d4FnpitvxIcbRI9Nl01P7E"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "6fL3o6XlpH97wbcQQkpg3Z",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2560,
"height": 1440
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "71asNAIwtAZq4DKjJ3k5YZ"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "edAc3cfJNCQJd0XDh0poPz"
},
{
"__type__": "3c532HQfoBBi78q+sTYBpzr",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"contentLabel": {
"__id__": 6
},
"containerNode": {
"__id__": 2
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "81f1XJM0JOWb0fH0GVh+PM"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"instance": null,
"targetOverrides": []
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f3d8831c-1525-4b2c-84b3-8f7d1910095f",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "CommonToast"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f5d33adb-6500-4a57-a4f7-e887749e98cd",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "MainUI"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "be15b5af-c87d-4d9a-9faa-954318e815a6",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "ShopUI"
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "e530c886-01d1-4780-a154-940c11ebc245",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "99123257-14dc-48cf-a23c-a1155cd6dd44",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,64 @@
import { _decorator } from "cc";
import { EventManager } from "@max-studio/core/event/EventManager";
import { Singleton } from "@max-studio/core/Singleton";
import LogUtils from "@max-studio/core/utils/LogUtils";
import { CurrencyEventMessage, CurrencyType } from "./Types";
const { ccclass, property } = _decorator;
@ccclass("CurrencyManager")
export class CurrencyManager extends Singleton {
private currencyValues: Record<CurrencyType, number> = {} as Record<CurrencyType, number>;
/** 获取货币值 */
public getCurrencyValue(type: CurrencyType): number {
return this.currencyValues[type] || 0;
}
/** 设置货币值 */
public setCurrencyValue(type: CurrencyType, value: number, isNotify: boolean = true) {
this.currencyValues[type] = value;
if (isNotify) {
EventManager.getInstance().emit(CurrencyEventMessage.CURRENCY_VALUE_CHANGED, type, value);
}
}
/** 格式化货币显示 */
public formatCurrencyDisplay(type: CurrencyType, value?: number): string {
const amount = value ?? this.getCurrencyValue(type);
// 根据货币类型返回不同的格式
if (amount >= 1000000) {
return `${(amount / 1000000).toFixed(1)}M`;
} else if (amount >= 1000) {
return `${(amount / 1000).toFixed(1)}K`;
}
return amount.toString();
}
/** 检查货币是否足够 */
public isCurrencyEnough(type: CurrencyType, amount: number): boolean {
return this.getCurrencyValue(type) >= amount;
}
/** 消耗货币 */
public consumeCurrency(type: CurrencyType, amount: number, isNotify: boolean = true): boolean {
if (amount <= 0) {
LogUtils.warn(`[CurrencyManager] 消耗货币数量必须大于0: ${amount}`);
return false;
}
if (!this.isCurrencyEnough(type, amount)) {
LogUtils.warn(`[CurrencyManager] 货币不足: ${type}, 需要: ${amount}, 当前: ${this.getCurrencyValue(type)}`);
return false;
}
const currentValue = this.getCurrencyValue(type);
const newValue = currentValue - amount;
this.setCurrencyValue(type, newValue, isNotify);
return true;
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "0474457b-c003-444f-b68b-9279920ba444",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,9 @@
export enum CurrencyType {
ENERGY = "energy",
GEM = "gem",
GOLD = "gold",
}
export enum CurrencyEventMessage {
CURRENCY_VALUE_CHANGED = 'currency_value_changed',
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "4eb1626b-f4b8-4566-b197-30c135c7e3a8",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "ea4b3885-21a2-4076-8162-00bd5ee2c090",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,46 @@
import { _decorator, Component, Enum, Label } from "cc";
import { EventManager } from "@max-studio/core/event/EventManager";
import UIManager from "@max-studio/core/ui/UIManager";
import LogUtils from "@max-studio/core/utils/LogUtils";
import { ShopUI } from "../../uis/ShopUI";
import { CurrencyManager } from "../CurrencyManager";
import { CurrencyEventMessage, CurrencyType } from "../Types";
import { onEvent } from "@max-studio/core/decorators";
const { ccclass, property } = _decorator;
@ccclass("CurrencyItem")
export class CurrencyItem extends Component {
@property({ type: Enum(CurrencyType) })
public type: CurrencyType = CurrencyType.ENERGY;
@property(Label)
public label: Label = null!;
protected onLoad(): void {
this.node.onClick(this.onGotoCurrencyShop, this);
}
private onGotoCurrencyShop() {
LogUtils.log("点击了货币商店:", this.type);
void UIManager.getInstance().openUI(ShopUI, this.type);
}
@onEvent(CurrencyEventMessage.CURRENCY_VALUE_CHANGED)
private onCurrencyValueChanged(type: CurrencyType, value: number) {
if (type !== this.type) {
return;
}
this.label.string = CurrencyManager.getInstance().formatCurrencyDisplay(this.type, value);
}
protected onDestroy(): void {
EventManager.getInstance().off(CurrencyEventMessage.CURRENCY_VALUE_CHANGED, this.onCurrencyValueChanged, this);
}
protected start(): void {
this.label.string = CurrencyManager.getInstance().formatCurrencyDisplay(this.type);
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "8840c2d8-d822-482c-b68f-2a88cd9c8e72",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "64114bf3-6b22-4ea3-b229-87984f6eb045",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,153 @@
import BasePopup from "@max-studio/core/ui/BasePopup";
import { uiConfig, UIType } from "@max-studio/core/ui/UIDecorator";
import UIManager from "@max-studio/core/ui/UIManager";
import { IDialogBoxOptions } from "assets/scripts/DialogBox";
import { Vec3 } from "cc";
import { Button } from "cc";
import { tween } from "cc";
import { Label } from "cc";
import { _decorator, Node } from "cc";
const { ccclass, property } = _decorator;
/**
* 基础对话框组件
*/
@uiConfig({
bundle: "games",
prefab: "prefabs/uis/CommonDialogBox",
isMulti: true,
isCache: true,
type: UIType.POPUP,
})
@ccclass("CommonDialogBox")
export class CommonDialogBox extends BasePopup {
@property(Label)
titleLabel: Label = null!;
@property(Node)
contentRoot: Node = null!;
@property(Label)
contentLabel: Label = null!;
@property(Button)
confirmBtn: Button = null!;
@property(Label)
confirmBtnLabel: Label = null!;
@property(Button)
cancelBtn: Button = null!;
@property(Label)
cancelBtnLabel: Label = null!;
@property(Button)
closeBtn: Button = null!;
// 回调函数
private onConfirmCallback: (() => void) | null = null;
private onCancelCallback: (() => void) | null = null;
protected onLoad(): void {
// 绑定按钮事件
if (this.confirmBtn) {
this.confirmBtn.node.on(Button.EventType.CLICK, this.onConfirmClick, this);
}
if (this.cancelBtn) {
this.cancelBtn.node.on(Button.EventType.CLICK, this.onCancelClick, this);
}
if (this.closeBtn) {
this.closeBtn.node.on(Button.EventType.CLICK, this.onCloseClick, this);
}
}
/**
* 确定按钮点击事件
*/
private onConfirmClick(): void {
// 执行回调
if (this.onConfirmCallback) {
this.onConfirmCallback();
}
// 隐藏对话框
void UIManager.getInstance().closeUI(this);
}
async onShow(options: IDialogBoxOptions = {}) {
this.contentRoot.scale = Vec3.ZERO;
tween(this.contentRoot).to(0.3, { scale: Vec3.ONE }, { easing: "backOut" }).start();
const {
title = "提示",
content = "",
onConfirm,
onCancel,
confirmText = "确定",
cancelText = "取消",
showCancel = true,
hideClose = false,
} = options;
// 设置标题和内容
if (this.titleLabel) {
this.titleLabel.string = title;
}
if (this.contentLabel) {
this.contentLabel.string = content;
}
// 设置按钮文本
if (this.confirmBtnLabel) {
this.confirmBtnLabel.string = confirmText;
}
if (this.cancelBtnLabel) {
this.cancelBtnLabel.string = cancelText;
}
// 控制取消按钮显示状态
if (this.cancelBtn) {
this.cancelBtn.node.active = showCancel;
}
if (this.closeBtn) {
this.closeBtn.node.active = !hideClose;
}
// 保存回调函数
this.onConfirmCallback = onConfirm || null;
this.onCancelCallback = onCancel || null;
}
/**
* 取消按钮点击事件
*/
private onCancelClick(): void {
// 执行回调
if (this.onCancelCallback) {
this.onCancelCallback();
}
// 隐藏对话框
void UIManager.getInstance().closeUI(this);
}
private onCloseClick(): void {
// 隐藏对话框
void UIManager.getInstance().closeUI(this);
}
async onHide(): Promise<void> {
return new Promise((resolve) => {
tween(this.contentRoot)
.to(0.2, { scale: new Vec3(0.8, 0.8, 0.8) }, { easing: "quadIn" })
.call(() => {
resolve();
})
.start();
});
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "ee46f250-e044-478d-91ea-70023cf1ce2e",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,77 @@
import BaseToast from "@max-studio/core/ui/BaseToast";
import { uiConfig, UIType } from "@max-studio/core/ui/UIDecorator";
import UIManager from "@max-studio/core/ui/UIManager";
import { SpriteAtlas, tween, Vec3, UITransform } from "cc";
import { RichText } from "cc";
import { _decorator, Component, Node } from "cc";
const { ccclass, property } = _decorator;
@uiConfig({
prefab: "prefabs/uis/CommonToast",
bundle: "games",
type: UIType.TOAST,
isMulti: true,
isCache: true,
})
@ccclass("CommonToast")
export class CommonToast extends BaseToast {
@property(RichText)
private contentLabel: RichText;
@property(Node)
private containerNode: Node;
async onShow(tip: string, atlas: SpriteAtlas): Promise<void> {
if (atlas) {
this.contentLabel.imageAtlas = atlas;
}
this.contentLabel.string = tip;
// 播放滑入动画
this.playSlideInAnimation();
// 显示3秒后自动滑出
this.scheduleOnce(() => {
this.playSlideOutAnimation();
}, 2);
}
/**
* 播放滑入动画
*/
private playSlideInAnimation() {
this.containerNode.setPosition(0, 930, 0);
// 播放滑入动画
tween(this.containerNode)
.to(
0.5,
{ position: new Vec3(0, 720, 0) },
{
easing: "backOut",
},
)
.start();
}
/**
* 播放滑出动画
*/
private playSlideOutAnimation() {
// 滑出到屏幕顶部外面
const endY = 930;
tween(this.containerNode)
.to(
0.3,
{ position: new Vec3(0, endY, 0) },
{
easing: "backIn",
},
)
.call(() => {
UIManager.getInstance().closeUI(this);
})
.start();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "3c5321d0-7e80-418b-bf2a-fac4d8069ceb",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,22 @@
import { _decorator } from "cc";
import BaseLayer from "@max-studio/core/ui/BaseLayer";
import { uiConfig, UIType } from "@max-studio/core/ui/UIDecorator";
import UIManager from "@max-studio/core/ui/UIManager";
import { CommonDialogBox } from "./CommonDialogBox";
import { CommonToast } from "./CommonToast";
import { ResManager } from "@max-studio/core/res/ResManager";
import { SpriteAtlas } from "cc";
const { ccclass, property, menu } = _decorator;
@ccclass("MainUI")
@uiConfig({
prefab: "prefabs/uis/MainUI",
bundle: "games",
isCache: false,
})
@menu("max/ui/MainUI")
export class MainUI extends BaseLayer {
async onShow(...args: any[]) {}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "66960106-0303-42e3-9866-7750a922851b",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,23 @@
import { _decorator } from "cc";
import BaseLayer from "@max-studio/core/ui/BaseLayer";
import { uiConfig, UIType } from "@max-studio/core/ui/UIDecorator";
const { ccclass, property, menu } = _decorator;
@ccclass("ShopUI")
@uiConfig({
prefab: "prefabs/uis/ShopUI",
bundle: "games",
type: UIType.NORMAL,
isMulti: false,
isCache: false,
})
@menu("max/ui/ShopUI")
export class ShopUI extends BaseLayer {
protected onLoad(): void {
// ProtoDefinitions.pkg1.User
let user = new ProtoDefinitions.pkg1.User();
console.log(user, ProtoDefinitions.pkg1.User.encode(user));
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "2c244a4a-c1be-4ed6-a768-4e60bfc0a520",
"files": [],
"subMetas": {},
"userData": {}
}