bigwin动画

This commit is contained in:
TJH 2025-12-18 16:24:37 +08:00
parent 8c73a82ba5
commit 0efd166fae
4 changed files with 847 additions and 247 deletions

View File

@ -28,23 +28,32 @@
"__id__": 16
},
{
"__id__": 24
"__id__": 22
},
{
"__id__": 32
"__id__": 28
},
{
"__id__": 36
},
{
"__id__": 44
},
{
"__id__": 52
}
],
"_active": true,
"_components": [
{
"__id__": 38
"__id__": 58
},
{
"__id__": 40
"__id__": 60
}
],
"_prefab": {
"__id__": 42
"__id__": 62
},
"_lpos": {
"__type__": "cc.Vec3",
@ -252,7 +261,7 @@
},
{
"__type__": "cc.Node",
"_name": "winMain",
"_name": "bigwinMain",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
@ -314,13 +323,13 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1957.3199462890625,
"height": 3054.2099609375
"width": 1272,
"height": 1383
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.51614965731415,
"y": 0.49414086792980105
"x": 0.485062893081761,
"y": 0.4642082429501085
},
"_id": ""
},
@ -351,11 +360,11 @@
"a": 255
},
"_skeletonData": {
"__uuid__": "60909bfc-2af4-45d3-9f3b-6ac50df88aa5",
"__uuid__": "e1b0817d-1086-4098-8037-e1c94a474c9b",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "BigWin_in",
"defaultAnimation": "",
"_premultipliedAlpha": false,
"_timeScale": 1,
"_preCacheMode": 0,
@ -388,27 +397,24 @@
},
{
"__type__": "cc.Node",
"_name": "winLabel",
"_name": "megawinMain",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 17
},
{
"__id__": 19
},
{
"__id__": 21
}
],
"_prefab": {
"__id__": 23
"__id__": 21
},
"_lpos": {
"__type__": "cc.Vec3",
@ -453,19 +459,19 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 840,
"height": 443
"width": 1710,
"height": 2136
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.4994047619047619,
"y": 0.154627539503386
"x": 0.5087719298245614,
"y": 0.44756554307116103
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e9xbtCTA9F/Ju/Ut9zaIhE"
"fileId": "fc+plqy8FAJJdas7BJz4nw"
},
{
"__type__": "sp.Skeleton",
@ -490,11 +496,11 @@
"a": 255
},
"_skeletonData": {
"__uuid__": "02425149-d24f-4e6a-94fa-e53a38ed7194",
"__uuid__": "76451466-8443-4282-be88-93d376c38cd8",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "<None>",
"defaultAnimation": "",
"_premultipliedAlpha": false,
"_timeScale": 1,
"_preCacheMode": 0,
@ -510,28 +516,301 @@
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fa4L+9yixNH4MSy10gSgy1"
"fileId": "0a8XbTQLBKJ7XunpNh1but"
},
{
"__type__": "fff06/47+JN56ma8UHb0Aj4",
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "ccgaaWpFxHVIWzLho3dFwL",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "supermegawinMain",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 23
},
{
"__id__": 25
}
],
"_prefab": {
"__id__": 27
},
"_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.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 16
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 22
"__id__": 24
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1560,
"height": 2138
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.4476145930776427
},
"spineName": "WinWinWin",
"defaultAnimation": "",
"autoPlay": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c6epvKRAJK6YUGDbkQHMHr"
"fileId": "9dkbLqvQ1L9aawQJ3bUjl+"
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 26
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_skeletonData": {
"__uuid__": "5076a341-19a4-4edc-8fbb-6c5f1ca538ae",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "",
"_premultipliedAlpha": false,
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
"_debugSlots": false,
"_enableBatch": false,
"loop": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "a2aKAYfZxME4hILEwgu0EF"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "9ccymolFVNPoTiQi+xmHGh",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "bigwinLabel",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 29
},
{
"__id__": 31
},
{
"__id__": 33
}
],
"_prefab": {
"__id__": 35
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 160.897,
"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__": 28
},
"_enabled": true,
"__prefab": {
"__id__": 30
},
"_contentSize": {
"__type__": "cc.Size",
"width": 835,
"height": 259
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.4994047619047619,
"y": 0.154627539503386
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e9xbtCTA9F/Ju/Ut9zaIhE"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 28
},
"_enabled": true,
"__prefab": {
"__id__": 32
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "e6d3c304-91f2-48fb-b37e-f63974bdbec9@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": "8fJXO9/3tHBbBPdNpa1hVg"
},
{
"__type__": "e6c8d4szahIuLbtf6yx+hH6",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 28
},
"_enabled": true,
"__prefab": {
"__id__": 34
},
"spriteName": "17",
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "81zaF64VBORZ70ovuGh70k"
},
{
"__type__": "cc.PrefabInfo",
@ -548,115 +827,319 @@
},
{
"__type__": "cc.Node",
"_name": "megawinLabel",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_prefab": {
"__id__": 25
},
"__editorExtras__": {}
"_children": [],
"_active": true,
"_components": [
{
"__id__": 37
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 24
},
"asset": {
"__uuid__": "416765f1-4141-440b-9ec9-08dcd298f611",
"__expectedType__": "cc.Prefab"
},
"fileId": "c8UDm/VOpLB7va/IWyh84B",
"instance": {
"__id__": 26
},
"targetOverrides": []
"__id__": 39
},
{
"__type__": "cc.PrefabInstance",
"fileId": "28GYCF2rlEDLjebtBHtzRn",
"prefabRootNode": {
"__id__": 1
},
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 27
},
{
"__id__": 29
},
{
"__id__": 30
},
{
"__id__": 31
"__id__": 41
}
],
"removedComponents": []
"_prefab": {
"__id__": 43
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
},
"propertyPath": [
"_name"
],
"value": "particle"
},
{
"__type__": "cc.TargetInfo",
"localID": [
"c8UDm/VOpLB7va/IWyh84B"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
},
"propertyPath": [
"_lpos"
],
"value": {
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"y": 160.897,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
},
"propertyPath": [
"_lrot"
],
"value": {
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
"_lscale": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 1
},
"propertyPath": [
"_euler"
],
"value": {
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 36
},
"_enabled": true,
"__prefab": {
"__id__": 38
},
"_contentSize": {
"__type__": "cc.Size",
"width": 963,
"height": 244
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.4994047619047619,
"y": 0.154627539503386
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7aWlK871JBTaU3O4tQ9sj7"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 36
},
"_enabled": true,
"__prefab": {
"__id__": 40
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "d34cb71c-5426-4de0-b364-76e35900f7c4@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": "58tE+OjjJOmKgRvs8k1Eya"
},
{
"__type__": "e6c8d4szahIuLbtf6yx+hH6",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 36
},
"_enabled": true,
"__prefab": {
"__id__": 42
},
"spriteName": "18",
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e4chPJWHtLQacvRJXyTtYy"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "1elJ5lQE9Mg62ng5InozX9",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "supermegawinLabel",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 45
},
{
"__id__": 47
},
{
"__id__": 49
}
],
"_prefab": {
"__id__": 51
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 160.897,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"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__": 44
},
"_enabled": true,
"__prefab": {
"__id__": 46
},
"_contentSize": {
"__type__": "cc.Size",
"width": 966,
"height": 427
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.4994047619047619,
"y": 0.154627539503386
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "54tBEpE4NCL7RJ6DRrY/ur"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 44
},
"_enabled": true,
"__prefab": {
"__id__": 48
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "e1e39122-fcca-47e3-bebc-0eef33920872@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": "f7v9pFu0hM0p9m2pMWHX4n"
},
{
"__type__": "e6c8d4szahIuLbtf6yx+hH6",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 44
},
"_enabled": true,
"__prefab": {
"__id__": 50
},
"spriteName": "19",
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c9HYMcGnVAQYoRmZfVoXCw"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "82CUCPk+lK4qyU6BEqdL1K",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
@ -670,14 +1153,14 @@
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 53
},
{
"__id__": 35
"__id__": 55
}
],
"_prefab": {
"__id__": 37
"__id__": 57
},
"_lpos": {
"__type__": "cc.Vec3",
@ -714,11 +1197,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 32
"__id__": 52
},
"_enabled": true,
"__prefab": {
"__id__": 34
"__id__": 54
},
"_contentSize": {
"__type__": "cc.Size",
@ -742,11 +1225,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 32
"__id__": 52
},
"_enabled": true,
"__prefab": {
"__id__": 36
"__id__": 56
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@ -830,7 +1313,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 39
"__id__": 59
},
"_contentSize": {
"__type__": "cc.Size",
@ -858,7 +1341,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 41
"__id__": 61
},
"_alignFlags": 45,
"_target": null,
@ -894,11 +1377,6 @@
},
"fileId": "3fUZ77mfpOoapszHTzSb3E",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 24
}
]
"targetOverrides": null
}
]

View File

@ -114,6 +114,8 @@ export class SlotScene extends Component {
async start() {
await this.init();
// this.TotalWin.show(505000)
// this.BigWinUI.show(800000, WIN_TYPE.SUPER_MEGA_WIN, 10000)
}
private async init() {

View File

@ -28,7 +28,7 @@ export class BigWinUI extends Component {
isAnimationFinished: boolean = false; // 动画和数字滚动是否完成
scoreLabel: Label | null = null; // 分数节点
endTime: number = 5; // 动画完成后回收的时间
scrollTime: number = 8; // 是否是自动旋转
scrollTime: number = 7;
multis: number[] = [35, 50]; // 倍数区间
betAmount: number = 100000;
@ -36,15 +36,22 @@ export class BigWinUI extends Component {
onCloseCallBack: (() => void) | null = null;
winMainSpine: sp.Skeleton | null = null;
winLabelSpine: sp.Skeleton | null = null;
bigwinMainSpine: sp.Skeleton | null = null;
megawinMainSpine: sp.Skeleton | null = null;
supermegawinMainSpine: sp.Skeleton | null = null;
bigwinLabelSprite: Sprite | null = null;
megawinLabelSprite: Sprite | null = null;
supermegawinLabelSprite: Sprite | null = null;
// 添加金币特效节点引用
bwEffectNode: Node | null = null;
mewEffectNode: Node | null = null;
smwEffectNode: Node | null = null;
currentEffectNode: Node | null = null;
// bwEffectNode: Node | null = null;
// mewEffectNode: Node | null = null;
// smwEffectNode: Node | null = null;
// currentEffectNode: Node | null = null;
currentWinType: WIN_TYPE = WIN_TYPE.BIG_WIN; // 当前播放的动画类型
//当前正在播的动画
currentSpin = this.bigwinMainSpine
// 添加一个标记来区分是否是点击跳过
isSkipByTouch: boolean = false;
@ -52,17 +59,21 @@ export class BigWinUI extends Component {
this.bigWinUINode = NodePoolManager.instance.getNodeFromPoolStatic('bigWinUI', this.bigWinUiPre);
this.scoreLabel = this.bigWinUINode.getChildByName('score').getComponent(Label);
this.winMainSpine = this.bigWinUINode.getChildByName('winMain').getComponent(sp.Skeleton);
this.winLabelSpine = this.bigWinUINode.getChildByName('winLabel').getComponent(sp.Skeleton);
this.bigwinMainSpine = this.bigWinUINode.getChildByName('bigwinMain').getComponent(sp.Skeleton);
this.megawinMainSpine = this.bigWinUINode.getChildByName('megawinMain').getComponent(sp.Skeleton);
this.supermegawinMainSpine = this.bigWinUINode.getChildByName('supermegawinMain').getComponent(sp.Skeleton);
this.bigwinLabelSprite = this.bigWinUINode.getChildByName('bigwinLabel').getComponent(Sprite);
this.megawinLabelSprite = this.bigWinUINode.getChildByName('megawinLabel').getComponent(Sprite);
this.supermegawinLabelSprite = this.bigWinUINode.getChildByName('supermegawinLabel').getComponent(Sprite);
let winGoldParticle = this.bigWinUINode.getChildByName('particle');
// 获取各个等级的特效节点
this.bwEffectNode = winGoldParticle.getChildByName('BIGWIN');
this.mewEffectNode = winGoldParticle.getChildByName('MEGAWIN');
this.smwEffectNode = winGoldParticle.getChildByName('SUPERMEGAWIN');
// let winGoldParticle = this.bigWinUINode.getChildByName('particle');
// // 获取各个等级的特效节点
// this.bwEffectNode = winGoldParticle.getChildByName('BIGWIN');
// this.mewEffectNode = winGoldParticle.getChildByName('MEGAWIN');
// this.smwEffectNode = winGoldParticle.getChildByName('SUPERMEGAWIN');
// 初始时隐藏所有特效
this.hideAllEffects();
// this.hideAllEffects();
this.resetState();
@ -82,51 +93,51 @@ export class BigWinUI extends Component {
this.bigWinUINode.on(Node.EventType.TOUCH_START, this.onTouch, this);
this.node.addChild(this.bigWinUINode);
this.playSpineByType(WIN_TYPE.BIG_WIN, 'in');
this.playSpineByType(WIN_TYPE.BIG_WIN, 'ruchang');
this.startScoreAni();
}
// 隐藏所有特效节点
private hideAllEffects() {
if (this.bwEffectNode) this.bwEffectNode.active = false;
if (this.mewEffectNode) this.mewEffectNode.active = false;
if (this.smwEffectNode) this.smwEffectNode.active = false;
this.currentEffectNode = null;
}
// private hideAllEffects() {
// if (this.bwEffectNode) this.bwEffectNode.active = false;
// if (this.mewEffectNode) this.mewEffectNode.active = false;
// if (this.smwEffectNode) this.smwEffectNode.active = false;
// this.currentEffectNode = null;
// }
// 根据大奖类型显示对应特效
private showEffectByType(winType: WIN_TYPE) {
// 先隐藏当前显示的特效
this.hideAllEffects();
// private showEffectByType(winType: WIN_TYPE) {
// // 先隐藏当前显示的特效
// this.hideAllEffects();
// 根据类型显示对应特效
let targetNode: Node | null = null;
switch (winType) {
case WIN_TYPE.SUPER_MEGA_WIN:
targetNode = this.smwEffectNode;
break;
case WIN_TYPE.MEGA_WIN:
targetNode = this.mewEffectNode;
break;
case WIN_TYPE.BIG_WIN:
targetNode = this.bwEffectNode;
break;
}
// // 根据类型显示对应特效
// let targetNode: Node | null = null;
// switch (winType) {
// case WIN_TYPE.SUPER_MEGA_WIN:
// targetNode = this.smwEffectNode;
// break;
// case WIN_TYPE.MEGA_WIN:
// targetNode = this.mewEffectNode;
// break;
// case WIN_TYPE.BIG_WIN:
// targetNode = this.bwEffectNode;
// break;
// }
if (targetNode) {
targetNode.active = true;
this.currentEffectNode = targetNode;
// if (targetNode) {
// targetNode.active = true;
// this.currentEffectNode = targetNode;
// 播放该节点下的所有粒子系统
const particles = targetNode.getComponentsInChildren(ParticleSystem);
particles.forEach(particle => {
particle.stop();
particle.clear();
particle.play();
});
}
}
// // 播放该节点下的所有粒子系统
// const particles = targetNode.getComponentsInChildren(ParticleSystem);
// particles.forEach(particle => {
// particle.stop();
// particle.clear();
// particle.play();
// });
// }
// }
calculateDynamicTargets() {
this.dynamicTargets = [];
@ -167,7 +178,6 @@ export class BigWinUI extends Component {
if (this.dynamicTargets.length === 0) return;
let targetScore = this.dynamicTargets.shift()!;
// 修改这里的滚动逻辑
let startScore = this.currentScore;
let startTime = 0;
@ -179,12 +189,12 @@ export class BigWinUI extends Component {
startTime += dt;
let progress = Math.min(startTime / this.scrollTime, 1);
if (this.dynamicTargets.length == 0 && this.winType >= WIN_TYPE.MEGA_WIN) {
this.currentScore = targetScore;
} else {
// if (this.dynamicTargets.length == 0 && this.winType >= WIN_TYPE.MEGA_WIN) {
// this.currentScore = targetScore;
// } else {
let easedProgress = this.easeOutQuad(progress);
this.currentScore = startScore + (targetScore - startScore) * easedProgress;
}
// }
this.checkAndPlaySpineAnim(this.currentScore);
this.updateScoreLabel();
@ -216,31 +226,44 @@ export class BigWinUI extends Component {
let newWinType = this.getWinTypeByScore(score);
if (newWinType !== this.currentWinType) {
this.currentWinType = newWinType;
this.playSpineByType(this.currentWinType, 'in');
this.playSpineByType(this.currentWinType, 'ruchang');
}
}
showcurrentSpin() {
this.bigwinMainSpine.node.active = false
this.megawinMainSpine.node.active = false
this.supermegawinMainSpine.node.active = false
async playSpineByType(winType: WIN_TYPE, state: 'in' | 'loop' | 'out') {
if (!this.winMainSpine) return;
if (!this.winLabelSpine) return;
this.currentSpin.node.active = true
}
async playSpineByType(winType: WIN_TYPE, state: 'ruchang' | 'chixu' | 'jieshu') {
if (!this.bigwinMainSpine) return;
if (!this.bigwinLabelSprite) return;
let prefix = '';
switch (winType) {
case WIN_TYPE.SUPER_MEGA_WIN:
prefix = 'SuperMegaWin';
prefix = 'super';
this.currentSpin = this.supermegawinMainSpine
this.showcurrentSpin()
break;
case WIN_TYPE.MEGA_WIN:
prefix = 'MegaWin';
prefix = 'mega';
this.currentSpin = this.megawinMainSpine
this.showcurrentSpin()
break;
default:
prefix = 'BigWin';
prefix = 'big';
this.currentSpin = this.bigwinMainSpine
this.showcurrentSpin()
break;
}
const animName = `${prefix}_${state}`;
const animName = `${state}`;
if (state === 'in') {
if (state === 'ruchang') {
if (!this.isSkipByTouch) {
// 停止当前音效
this.bigWinAudio.stop();
@ -263,43 +286,33 @@ export class BigWinUI extends Component {
}
}
this.winMainSpine.setCompleteListener(() => {
this.playSpineByType(winType, 'loop');
this.currentSpin.setCompleteListener(() => {
this.playSpineByType(winType, 'chixu');
});
this.winMainSpine.setAnimation(0, animName, false);
this.currentSpin.setAnimation(0, animName, false);
this.winLabelSpine.setCompleteListener(() => {
this.playSpineByType(winType, 'loop');
});
this.winLabelSpine.setAnimation(0, animName, false);
this.playWinLabelAnimation(prefix, state)
// 显示对应类型的特效
this.showEffectByType(winType);
} else if (state === 'loop') {
// this.showEffectByType(winType);
} else if (state === 'chixu') {
this.winMainSpine.setCompleteListener(null);
this.winMainSpine.setAnimation(0, animName, true);
this.winLabelSpine.setCompleteListener(null);
this.winLabelSpine.setAnimation(0, animName, true);
// 显示对应类型的特效
this.showEffectByType(winType);
this.currentSpin.setCompleteListener(null);
this.currentSpin.setAnimation(0, animName, true);
this.playWinLabelAnimation(prefix, state)
} else {
this.winMainSpine.setCompleteListener(null);
this.winMainSpine.setAnimation(0, animName, false);
this.winLabelSpine.setCompleteListener(null);
this.winLabelSpine.setAnimation(0, animName, false);
this.currentSpin.setCompleteListener(null);
this.currentSpin.setAnimation(0, animName, false);
this.playWinLabelAnimation(prefix, state)
// 停止并隐藏特效
if (this.currentEffectNode) {
const particles = this.currentEffectNode.getComponentsInChildren(ParticleSystem);
particles.forEach(particle => {
particle.stop();
particle.clear();
});
}
this.hideAllEffects();
// if (this.currentEffectNode) {
// const particles = this.currentEffectNode.getComponentsInChildren(ParticleSystem);
// particles.forEach(particle => {
// particle.stop();
// particle.clear();
// });
// }
// this.hideAllEffects();
}
}
@ -313,7 +326,114 @@ export class BigWinUI extends Component {
return WIN_TYPE.BIG_WIN;
}
}
playWinLabelAnimation(prefix, state: string) {
if (state == 'ruchang') {
switch (prefix) {
case 'big':
Tween.stopAllByTag(100)
this.megawinLabelSprite.node.setScale(0, 0, 1)
this.supermegawinLabelSprite.node.setScale(0, 0, 1)
tween(this.bigwinLabelSprite.node)
.tag(100)
.to(0.5, { scale: v3(1.2, 1.2, 1) })
.to(0.2, { scale: v3(1, 1, 1) })
.start()
break
case 'mega':
Tween.stopAllByTag(100)
this.bigwinLabelSprite.node.setScale(0, 0, 1)
this.supermegawinLabelSprite.node.setScale(0, 0, 1)
tween(this.megawinLabelSprite.node)
.tag(100)
.to(0.5, { scale: v3(1.2, 1.2, 1) })
.to(0.2, { scale: v3(1, 1, 1) })
.start()
break
case 'super':
Tween.stopAllByTag(100)
this.megawinLabelSprite.node.setScale(0, 0, 1)
this.bigwinLabelSprite.node.setScale(0, 0, 1)
tween(this.supermegawinLabelSprite.node)
.tag(100)
.to(0.5, { scale: v3(1.2, 1.2, 1) })
.to(0.2, { scale: v3(1, 1, 1) })
.start()
break
}
} else if (state == 'chixu') {
switch (prefix) {
case 'big':
Tween.stopAllByTag(100)
let bigWinTween =
tween(this.bigwinLabelSprite.node)
.to(0.5, { scale: v3(1.1, 1.1, 1) })
.to(0.5, { scale: v3(1, 1, 1) })
tween(this.bigwinLabelSprite.node)
.tag(100)
.repeatForever(bigWinTween)
.start()
break
case 'mega':
Tween.stopAllByTag(100)
let megaWinTween =
tween(this.megawinLabelSprite.node)
.to(0.5, { scale: v3(1.1, 1.1, 1) })
.to(0.5, { scale: v3(1, 1, 1) })
tween(this.megawinLabelSprite.node)
.tag(100)
.repeatForever(megaWinTween)
.start()
break
case 'super':
Tween.stopAllByTag(100)
let superMegaWinTween =
tween(this.supermegawinLabelSprite.node)
.to(0.5, { scale: v3(1.1, 1.1, 1) })
.to(0.5, { scale: v3(1, 1, 1) })
tween(this.supermegawinLabelSprite.node)
.tag(100)
.repeatForever(superMegaWinTween)
.start()
break
}
} else {
switch (prefix) {
case 'big':
Tween.stopAllByTag(100)
tween(this.bigwinLabelSprite.node)
.tag(100)
.to(0.5, { scale: v3(1.3, 1.3, 1) })
.to(0.5, { scale: v3(0, 0, 1) })
.start()
break
case 'mega':
Tween.stopAllByTag(100)
tween(this.megawinLabelSprite.node)
.tag(100)
.to(0.5, { scale: v3(1.3, 1.3, 1) })
.to(0.5, { scale: v3(0, 0, 1) })
.start()
break
case 'super':
Tween.stopAllByTag(100)
tween(this.supermegawinLabelSprite.node)
.tag(100)
.to(0.5, { scale: v3(1.3, 1.3, 1) })
.to(0.5, { scale: v3(0, 0, 1) })
.start()
break
}
}
}
updateScoreLabel() {
if (this.scoreLabel) this.scoreLabel.string = gold2cash(this.currentScore);
}
@ -340,9 +460,9 @@ export class BigWinUI extends Component {
this.currentScore = this.winScore;
this.updateScoreLabel();
// 直接播放最终类型的start动画完成后自动切换到loop
this.playSpineByType(this.winType, 'in');
this.playSpineByType(this.winType, 'ruchang');
// 直接切换到最终特效
this.showEffectByType(this.winType);
// this.showEffectByType(this.winType);
this.bigWinAudio.stop();
this.bigWinAudio.clip = this.bigWinAudioClips[3];
if (!AudioManager.instance.getMuted()) {
@ -389,11 +509,8 @@ export class BigWinUI extends Component {
.to(0.3, { scale: v3(0, 0, 0) })
.start();
this.playSpineByType(this.winType, 'out');
this.winMainSpine.setCompleteListener(() => {
this.closeImmediately();
});
this.winLabelSpine.setCompleteListener(() => {
this.playSpineByType(this.winType, 'jieshu');
this.currentSpin.setCompleteListener(() => {
this.closeImmediately();
});
}
@ -405,22 +522,25 @@ export class BigWinUI extends Component {
}
// 停止所有特效
if (this.currentEffectNode) {
const particles = this.currentEffectNode.getComponentsInChildren(ParticleSystem);
particles.forEach(particle => {
particle.stop();
particle.clear();
});
}
this.hideAllEffects();
// if (this.currentEffectNode) {
// const particles = this.currentEffectNode.getComponentsInChildren(ParticleSystem);
// particles.forEach(particle => {
// particle.stop();
// particle.clear();
// });
// }
// this.hideAllEffects();
this.unscheduleAllCallbacks();
// 清理spine监听器
if (this.winMainSpine) {
this.winMainSpine.setCompleteListener(null);
if (this.bigwinMainSpine) {
this.bigwinMainSpine.setCompleteListener(null);
}
if (this.winLabelSpine) {
this.winLabelSpine.setCompleteListener(null);
if (this.megawinMainSpine) {
this.megawinMainSpine.setCompleteListener(null);
}
if (this.supermegawinMainSpine) {
this.supermegawinMainSpine.setCompleteListener(null);
}
this.bigWinUINode.off(Node.EventType.TOUCH_START, this.onTouch, this);
this.hide();

View File

@ -32,7 +32,7 @@ export function getHistoryUrl() {
}
export function getLanguage() {
// return 'my';
// return 'zh';
return language;
}