Merge branch 'feature/gacha-full-skin' into develop

feature/ads-smart-display
tiendat3699 2024-06-18 10:37:08 +07:00
commit 83a6a3e268
23 changed files with 15663 additions and 12799 deletions

View File

@ -1011,7 +1011,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 90,
"height": 80 "height": 80
}, },
"_anchorPoint": { "_anchorPoint": {
@ -1127,7 +1127,7 @@
"__id__": 80 "__id__": 80
}, },
"_collectSound": { "_collectSound": {
"__uuid__": "1ac12acc-dde3-4d31-9106-dfc30c030d40", "__uuid__": "ca7dc97e-d8a6-43f4-922d-14a2b5422cd6",
"__expectedType__": "cc.AudioClip" "__expectedType__": "cc.AudioClip"
}, },
"_animation": { "_animation": {

View File

@ -1011,7 +1011,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 90,
"height": 80 "height": 80
}, },
"_anchorPoint": { "_anchorPoint": {
@ -1127,7 +1127,7 @@
"__id__": 80 "__id__": 80
}, },
"_collectSound": { "_collectSound": {
"__uuid__": "1ac12acc-dde3-4d31-9106-dfc30c030d40", "__uuid__": "ca7dc97e-d8a6-43f4-922d-14a2b5422cd6",
"__expectedType__": "cc.AudioClip" "__expectedType__": "cc.AudioClip"
}, },
"_animation": { "_animation": {

View File

@ -1011,7 +1011,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 90,
"height": 80 "height": 80
}, },
"_anchorPoint": { "_anchorPoint": {
@ -1127,7 +1127,7 @@
"__id__": 80 "__id__": 80
}, },
"_collectSound": { "_collectSound": {
"__uuid__": "1ac12acc-dde3-4d31-9106-dfc30c030d40", "__uuid__": "ca7dc97e-d8a6-43f4-922d-14a2b5422cd6",
"__expectedType__": "cc.AudioClip" "__expectedType__": "cc.AudioClip"
}, },
"_animation": { "_animation": {

View File

@ -1011,7 +1011,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 90,
"height": 80 "height": 80
}, },
"_anchorPoint": { "_anchorPoint": {
@ -1127,7 +1127,7 @@
"__id__": 80 "__id__": 80
}, },
"_collectSound": { "_collectSound": {
"__uuid__": "1ac12acc-dde3-4d31-9106-dfc30c030d40", "__uuid__": "ca7dc97e-d8a6-43f4-922d-14a2b5422cd6",
"__expectedType__": "cc.AudioClip" "__expectedType__": "cc.AudioClip"
}, },
"_animation": { "_animation": {

View File

@ -24,18 +24,18 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 10
},
{ {
"__id__": 12 "__id__": 12
}, },
{ {
"__id__": 14 "__id__": 14
},
{
"__id__": 16
} }
], ],
"_prefab": { "_prefab": {
"__id__": 18 "__id__": 20
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -85,14 +85,17 @@
}, },
{ {
"__id__": 7 "__id__": 7
},
{
"__id__": 9
} }
], ],
"_prefab": { "_prefab": {
"__id__": 9 "__id__": 11
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 46.12109375, "x": 46.12109375000001,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@ -133,7 +136,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 40, "width": 39.11764705882353,
"height": 35 "height": 35
}, },
"_anchorPoint": { "_anchorPoint": {
@ -207,7 +210,7 @@
"_alignFlags": 34, "_alignFlags": 34,
"_target": null, "_target": null,
"_left": 20.619999999999997, "_left": 20.619999999999997,
"_right": -45, "_right": -44.11764705882353,
"_top": 0, "_top": 0,
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
@ -228,6 +231,24 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "c6jbkI4Y1DIY6xOK2rRAGv" "fileId": "c6jbkI4Y1DIY6xOK2rRAGv"
}, },
{
"__type__": "2291brx8LpIc5DogteLVdjM",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2e0dbL5a1NFq59fBhH5ViM"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -251,7 +272,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 11 "__id__": 13
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -279,7 +300,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 13 "__id__": 15
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@ -350,17 +371,17 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 15 "__id__": 17
}, },
"_label": { "_label": {
"__id__": 12 "__id__": 14
}, },
"_sprite": { "_sprite": {
"__id__": 5 "__id__": 5
}, },
"_moveSpeed": 50, "_moveSpeed": 50,
"_animationCurve": { "_animationCurve": {
"__id__": 16 "__id__": 18
}, },
"_id": "" "_id": ""
}, },
@ -371,7 +392,7 @@
{ {
"__type__": "cc.AnimationCurve", "__type__": "cc.AnimationCurve",
"_curve": { "_curve": {
"__id__": 17 "__id__": 19
} }
}, },
{ {

View File

@ -24,18 +24,18 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 40
},
{
"__id__": 42
},
{ {
"__id__": 44 "__id__": 44
},
{
"__id__": 46
},
{
"__id__": 48
} }
], ],
"_prefab": { "_prefab": {
"__id__": 46 "__id__": 50
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -85,23 +85,23 @@
"__id__": 17 "__id__": 17
}, },
{ {
"__id__": 23 "__id__": 25
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 29 "__id__": 33
}, },
{ {
"__id__": 31 "__id__": 35
}, },
{ {
"__id__": 37 "__id__": 41
} }
], ],
"_prefab": { "_prefab": {
"__id__": 39 "__id__": 43
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -498,10 +498,13 @@
}, },
{ {
"__id__": 20 "__id__": 20
},
{
"__id__": 22
} }
], ],
"_prefab": { "_prefab": {
"__id__": 22 "__id__": 24
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -585,7 +588,7 @@
"_spriteFrame": null, "_spriteFrame": null,
"_type": 0, "_type": 0,
"_fillType": 0, "_fillType": 0,
"_sizeMode": 1, "_sizeMode": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0, "x": 0,
@ -602,6 +605,24 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "5bp0bh7QtOdYSYqKSecZXS" "fileId": "5bp0bh7QtOdYSYqKSecZXS"
}, },
{
"__type__": "2291brx8LpIc5DogteLVdjM",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 17
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8ecYdHwx1C0r1QDOjbEz29"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -627,14 +648,17 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 26
}, },
{ {
"__id__": 26 "__id__": 28
},
{
"__id__": 30
} }
], ],
"_prefab": { "_prefab": {
"__id__": 28 "__id__": 32
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -671,11 +695,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 23 "__id__": 25
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 25 "__id__": 27
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -699,11 +723,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 23 "__id__": 25
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 27 "__id__": 29
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@ -718,7 +742,7 @@
"_spriteFrame": null, "_spriteFrame": null,
"_type": 0, "_type": 0,
"_fillType": 0, "_fillType": 0,
"_sizeMode": 1, "_sizeMode": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0, "x": 0,
@ -735,6 +759,24 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "35J3m92mFAsLCZJtt+wVE3" "fileId": "35J3m92mFAsLCZJtt+wVE3"
}, },
{
"__type__": "2291brx8LpIc5DogteLVdjM",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 25
},
"_enabled": true,
"__prefab": {
"__id__": 31
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6eRV4oDuBB87jqJLNT3pkJ"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -758,7 +800,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 30 "__id__": 34
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -786,7 +828,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 32 "__id__": 36
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@ -810,16 +852,16 @@
"_cacheMode": 0, "_cacheMode": 0,
"_sockets": [ "_sockets": [
{ {
"__id__": 33 "__id__": 37
}, },
{ {
"__id__": 34 "__id__": 38
}, },
{ {
"__id__": 35 "__id__": 39
}, },
{ {
"__id__": 36 "__id__": 40
} }
], ],
"_useTint": false, "_useTint": false,
@ -859,7 +901,7 @@
"__type__": "sp.Skeleton.SpineSocket", "__type__": "sp.Skeleton.SpineSocket",
"path": "root/card2/card2-flip", "path": "root/card2/card2-flip",
"target": { "target": {
"__id__": 23 "__id__": 25
} }
}, },
{ {
@ -872,7 +914,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 38 "__id__": 42
}, },
"ignoreTimeScale": true, "ignoreTimeScale": true,
"_id": "" "_id": ""
@ -904,7 +946,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 41 "__id__": 45
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -932,10 +974,10 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 43 "__id__": 47
}, },
"skeleton": { "skeleton": {
"__id__": 31 "__id__": 35
}, },
"_flipX": false, "_flipX": false,
"_flipY": false, "_flipY": false,
@ -955,10 +997,10 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 45 "__id__": 49
}, },
"animationHandler": { "animationHandler": {
"__id__": 42 "__id__": 46
}, },
"spineRoot": { "spineRoot": {
"__id__": 2 "__id__": 2
@ -968,7 +1010,7 @@
"__id__": 20 "__id__": 20
}, },
{ {
"__id__": 26 "__id__": 28
} }
], ],
"_id": "" "_id": ""

View File

@ -24,18 +24,18 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 40
},
{ {
"__id__": 42 "__id__": 42
}, },
{ {
"__id__": 44 "__id__": 44
},
{
"__id__": 46
} }
], ],
"_prefab": { "_prefab": {
"__id__": 46 "__id__": 48
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -84,18 +84,18 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 32
},
{ {
"__id__": 34 "__id__": 34
}, },
{ {
"__id__": 37 "__id__": 36
},
{
"__id__": 39
} }
], ],
"_prefab": { "_prefab": {
"__id__": 39 "__id__": 41
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -303,11 +303,11 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 29 "__id__": 31
} }
], ],
"_prefab": { "_prefab": {
"__id__": 31 "__id__": 33
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -351,20 +351,20 @@
"__id__": 12 "__id__": 12
}, },
{ {
"__id__": 18 "__id__": 20
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 26
}, },
{ {
"__id__": 26 "__id__": 28
} }
], ],
"_prefab": { "_prefab": {
"__id__": 28 "__id__": 30
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -411,15 +411,18 @@
}, },
{ {
"__id__": 15 "__id__": 15
},
{
"__id__": 17
} }
], ],
"_prefab": { "_prefab": {
"__id__": 17 "__id__": 19
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": -50, "y": -25,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@ -459,8 +462,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 200, "width": 150,
"height": 200 "height": 150
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -495,10 +498,7 @@
"b": 255, "b": 255,
"a": 255 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": null,
"__uuid__": "e993110b-c53f-4d5c-bf69-b58cf61036b4@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0, "_type": 0,
"_fillType": 0, "_fillType": 0,
"_sizeMode": 0, "_sizeMode": 0,
@ -518,6 +518,24 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "ecbp9qmr5AsK8U3oG22/LR" "fileId": "ecbp9qmr5AsK8U3oG22/LR"
}, },
{
"__type__": "2291brx8LpIc5DogteLVdjM",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2fv6Ri0adHYqS4RF9PY2mq"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -527,8 +545,6 @@
"__id__": 0 "__id__": 0
}, },
"fileId": "01q2I1EmNPXr4APxBvWUXg", "fileId": "01q2I1EmNPXr4APxBvWUXg",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{ {
@ -543,19 +559,19 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 21
}, },
{ {
"__id__": 21 "__id__": 23
} }
], ],
"_prefab": { "_prefab": {
"__id__": 23 "__id__": 25
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": -193.8, "y": -143.8,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@ -587,11 +603,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 18 "__id__": 20
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 20 "__id__": 22
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -615,11 +631,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 18 "__id__": 20
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 22 "__id__": 24
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@ -703,7 +719,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 25 "__id__": 27
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -731,7 +747,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 27 "__id__": 29
}, },
"_resizeMode": 0, "_resizeMode": 0,
"_layoutType": 2, "_layoutType": 2,
@ -782,7 +798,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 30 "__id__": 32
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -823,7 +839,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 33 "__id__": 35
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -851,7 +867,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 35 "__id__": 37
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@ -875,7 +891,7 @@
"_cacheMode": 0, "_cacheMode": 0,
"_sockets": [ "_sockets": [
{ {
"__id__": 36 "__id__": 38
} }
], ],
"_useTint": false, "_useTint": false,
@ -907,7 +923,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 38 "__id__": 40
}, },
"ignoreTimeScale": true, "ignoreTimeScale": true,
"_id": "" "_id": ""
@ -939,7 +955,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 41 "__id__": 43
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@ -967,10 +983,10 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 43 "__id__": 45
}, },
"skeleton": { "skeleton": {
"__id__": 34 "__id__": 36
}, },
"_flipX": false, "_flipX": false,
"_flipY": false, "_flipY": false,
@ -990,10 +1006,10 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 45 "__id__": 47
}, },
"animationHandler": { "animationHandler": {
"__id__": 42 "__id__": 44
}, },
"spineRoot": { "spineRoot": {
"__id__": 2 "__id__": 2
@ -1005,7 +1021,7 @@
"__id__": 15 "__id__": 15
}, },
"rewardLabel": { "rewardLabel": {
"__id__": 21 "__id__": 23
}, },
"_id": "" "_id": ""
}, },

View File

@ -330,7 +330,7 @@
"__expectedType__": "cc.AudioClip" "__expectedType__": "cc.AudioClip"
}, },
"_score": 0, "_score": 0,
"_bonusTime": 10, "_bonusTime": 5,
"_id": "" "_id": ""
}, },
{ {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
{
"ver": "1.1.50",
"importer": "scene",
"imported": true,
"uuid": "8eb392e2-dfc6-410a-9878-b5a65b2550f5",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -338,16 +338,7 @@ AudioSource.prototype.getPlaybackRate = function () {
}; };
AudioSource.prototype.setPlaybackRate = function (value: number) { AudioSource.prototype.setPlaybackRate = function (value: number) {
if (this._player) {
try {
this._player._player._sourceNode.playbackRate.value = value;
} catch (e) {
console.log(e);
}
this._playbackRate = this._player.playbackRate;
} else {
this._playbackRate = value; this._playbackRate = value;
}
}; };
//#endregion //#endregion

View File

@ -7,7 +7,6 @@ import {
game, game,
Label, Label,
Node, Node,
random,
randomRangeInt, randomRangeInt,
RealCurve, RealCurve,
sp, sp,

View File

@ -125,9 +125,9 @@ export default class AudioManager {
} }
this._audioSourceBgm.loop = config.loop; this._audioSourceBgm.loop = config.loop;
this._audioSourceBgm.volume = config.volume; this._audioSourceBgm.volume = config.volume;
this._audioSourceBgm.playbackRate = config.playbackRate;
this._audioSourceBgm.mute = this._isMute; this._audioSourceBgm.mute = this._isMute;
this._audioSourceBgm.play(); this._audioSourceBgm.play();
this._audioSourceBgm.playbackRate = config.playbackRate;
} }
public static setPlayRateBGM(rate: number) { public static setPlayRateBGM(rate: number) {

View File

@ -7,6 +7,7 @@ import {
easing, easing,
Enum, Enum,
game, game,
Label,
lerp, lerp,
Node, Node,
SpriteFrame, SpriteFrame,
@ -75,6 +76,8 @@ export default class GachaManager extends Singleton<GachaManager>() {
private container: UIOpacity; private container: UIOpacity;
@property(FloatingTextFactory) @property(FloatingTextFactory)
private floatingScoreFactory: FloatingTextFactory; private floatingScoreFactory: FloatingTextFactory;
@property(Label)
private countDownLabel: Label;
@property(Gacha) @property(Gacha)
private gachas: Gacha[] = []; private gachas: Gacha[] = [];
@property(RewardConfig) @property(RewardConfig)
@ -84,10 +87,17 @@ export default class GachaManager extends Singleton<GachaManager>() {
private _showing: boolean = false; private _showing: boolean = false;
private _showTimer: number = 0; private _showTimer: number = 0;
private _idType: GachaType; private _idType: GachaType;
private _currentGacha: GachaBase;
protected onLoad(): void { protected onLoad(): void {
super.onLoad(); super.onLoad();
this.container.setNodeActive(false); this.container.setNodeActive(false);
this.countDownLabel.setNodeActive(false);
this.gachas.forEach((gacha) => gacha.gacha.setNodeActive(false));
}
public showBtn(_, data: string) {
this.show(GachaType[data]);
} }
public async show(type: GachaType, delay: number = 0) { public async show(type: GachaType, delay: number = 0) {
@ -117,8 +127,9 @@ export default class GachaManager extends Singleton<GachaManager>() {
} }
private showGacha() { private showGacha() {
const gacha = this.gachas.find((gacha) => gacha.type == this._idType); this._currentGacha = this.gachas.find((gacha) => gacha.type == this._idType).gacha;
gacha.gacha.show(); this._currentGacha.setNodeActive(true);
this._currentGacha.show();
} }
public async getReward(): Promise<RewardConfig> { public async getReward(): Promise<RewardConfig> {
@ -141,14 +152,23 @@ export default class GachaManager extends Singleton<GachaManager>() {
} }
public async gachaDone() { public async gachaDone() {
console.log(`Gacha reward: ${RewardType[this._reward.type]} quantity: ${this._reward.quantity}`);
await Utils.delay(1); await Utils.delay(1);
this._currentGacha.setNodeActive(false);
this.countDownLabel.setNodeActive(true);
console.log(`Gacha reward: ${RewardType[this._reward.type]} quantity: ${this._reward.quantity}`);
let count = 3;
while (count >= 0) {
this.countDownLabel.setString(count == 0 ? 'Ready' : count);
count--;
await Utils.delay(0.5);
}
game.timeScale = 1; game.timeScale = 1;
tween(this.container) tween(this.container)
.to(0.1, { opacity: 0 }) .to(0.1, { opacity: 0 })
.call(() => { .call(() => {
this.container.setNodeActive(false); this.container.setNodeActive(false);
this.countDownLabel.setNodeActive(false);
switch (this._reward.type) { switch (this._reward.type) {
case RewardType.Star: case RewardType.Star:
GameManager.instance.addScore(this._reward.quantity, ScoreType.DestroyObject); GameManager.instance.addScore(this._reward.quantity, ScoreType.DestroyObject);

View File

@ -0,0 +1,60 @@
import { _decorator, Component, director, Director, math, Node, Size, Sprite, UITransform } from 'cc';
const { ccclass, property, requireComponent, executeInEditMode } = _decorator;
@ccclass('PreserveAspectRatioSprite')
@requireComponent(Sprite)
@executeInEditMode
export class PreserveAspectRatioSprite extends Component {
private _sprite: Sprite;
private _uiTransform: UITransform;
protected onLoad(): void {}
protected onEnable() {
this._sprite = this.getComponent(Sprite);
this._uiTransform = this.getComponent(UITransform);
this.addEventListeners();
this.resize();
}
protected onDisable() {
this.removeEventListeners();
}
protected addEventListeners() {
director.on(Director.EVENT_AFTER_UPDATE, this.resize, this);
this.node.off(Node.EventType.ANCHOR_CHANGED, this.resize, this);
this.node.off(Node.EventType.SIZE_CHANGED, this.resize, this);
}
protected removeEventListeners() {
director.off(Director.EVENT_AFTER_UPDATE, this.resize, this);
this.node.off(Node.EventType.SIZE_CHANGED, this.resize, this);
this.node.off(Node.EventType.ANCHOR_CHANGED, this.resize, this);
}
protected resize() {
if (!this._sprite.spriteFrame) {
return;
}
const spriteSize = this._sprite.spriteFrame.originalSize;
const rectSize = this._uiTransform.contentSize.clone();
const spriteRatio = spriteSize.x / spriteSize.y;
const rectRatio = rectSize.width / rectSize.height;
if (spriteRatio > rectRatio) {
const oldHeight = rectSize.height;
rectSize.height = rectSize.width * (1 / spriteRatio);
rectSize.y += (oldHeight - rectSize.height) * this._uiTransform.anchorY;
} else {
const oldWidth = rectSize.width;
rectSize.width = rectSize.height * spriteRatio;
rectSize.x += (oldWidth - rectSize.width) * this._uiTransform.anchorX;
}
this._uiTransform.contentSize = rectSize;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "2291baf1-f0ba-4873-90e8-82d78b55d8cc",
"files": [],
"subMetas": {},
"userData": {}
}