feat: update gacha sfx
parent
037c5b8d7b
commit
0c5c905ead
|
@ -932,6 +932,8 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "42MH7u9olEzbD3eARpEEGO",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -1011,6 +1013,18 @@
|
|||
"__id__": 28
|
||||
}
|
||||
],
|
||||
"showSfx": {
|
||||
"__uuid__": "239a95de-d63b-48eb-be24-28ebec455f99",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"selectCardSfx": {
|
||||
"__uuid__": "2b5160a6-db5c-4925-9cb9-620c46695762",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"openCardSfx": {
|
||||
"__uuid__": "23a142a8-835d-4f43-8c3a-acbfadc56c23",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
@ -1026,7 +1040,6 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "244TXoUqdKA4qqvhPODAbd",
|
||||
"instance": null,
|
||||
"targetOverrides": null
|
||||
"targetOverrides": []
|
||||
}
|
||||
]
|
|
@ -1025,6 +1025,10 @@
|
|||
"rewardLabel": {
|
||||
"__id__": 23
|
||||
},
|
||||
"openSound": {
|
||||
"__uuid__": "37e56b7e-d9f1-46d7-8df3-21766bd1c253",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
|
|
@ -3159,6 +3159,22 @@
|
|||
},
|
||||
"wheelBoneName": "wheel",
|
||||
"speed": 3,
|
||||
"showSfx": {
|
||||
"__uuid__": "d03f0c89-dd68-4d13-af73-918b39cf7953",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"btnSfx": {
|
||||
"__uuid__": "4d36d11c-3612-4f53-a3fd-d3b55b73422c",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"spinSfx": {
|
||||
"__uuid__": "d0d5f5b7-dd0a-46cc-8957-9270fece9d32",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"stopSfx": {
|
||||
"__uuid__": "f0506909-3673-4420-99d8-c2e45c9b72a7",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"spinCurve": {
|
||||
"__id__": 144
|
||||
},
|
||||
|
@ -3324,7 +3340,6 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "b0CgrEZDdPP6qjRGc5LHCx",
|
||||
"instance": null,
|
||||
"targetOverrides": null
|
||||
"targetOverrides": []
|
||||
}
|
||||
]
|
|
@ -1025,6 +1025,10 @@
|
|||
"rewardLabel": {
|
||||
"__id__": 23
|
||||
},
|
||||
"openSound": {
|
||||
"__uuid__": "37e56b7e-d9f1-46d7-8df3-21766bd1c253",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1013,6 +1013,18 @@
|
|||
"__id__": 28
|
||||
}
|
||||
],
|
||||
"showSfx": {
|
||||
"__uuid__": "239a95de-d63b-48eb-be24-28ebec455f99",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"selectCardSfx": {
|
||||
"__uuid__": "2b5160a6-db5c-4925-9cb9-620c46695762",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"openCardSfx": {
|
||||
"__uuid__": "23a142a8-835d-4f43-8c3a-acbfadc56c23",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
@ -1028,7 +1040,6 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "244TXoUqdKA4qqvhPODAbd",
|
||||
"instance": null,
|
||||
"targetOverrides": null
|
||||
"targetOverrides": []
|
||||
}
|
||||
]
|
|
@ -3525,6 +3525,7 @@
|
|||
"__id__": 129
|
||||
}
|
||||
],
|
||||
"sprites": [],
|
||||
"cardSlotPath": [
|
||||
4,
|
||||
5,
|
||||
|
@ -3561,7 +3562,6 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "ec0xxH/etG0KDLbW0fRRht",
|
||||
"instance": null,
|
||||
"targetOverrides": null
|
||||
}
|
||||
]
|
|
@ -545,6 +545,8 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "01q2I1EmNPXr4APxBvWUXg",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -1023,6 +1025,10 @@
|
|||
"rewardLabel": {
|
||||
"__id__": 23
|
||||
},
|
||||
"openSound": {
|
||||
"__uuid__": "37e56b7e-d9f1-46d7-8df3-21766bd1c253",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
@ -1038,7 +1044,6 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "d8nEtFnupHxp1DyuqkemXx",
|
||||
"instance": null,
|
||||
"targetOverrides": null
|
||||
"targetOverrides": []
|
||||
}
|
||||
]
|
|
@ -3159,6 +3159,22 @@
|
|||
},
|
||||
"wheelBoneName": "wheel",
|
||||
"speed": 3,
|
||||
"showSfx": {
|
||||
"__uuid__": "d03f0c89-dd68-4d13-af73-918b39cf7953",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"btnSfx": {
|
||||
"__uuid__": "4d36d11c-3612-4f53-a3fd-d3b55b73422c",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"spinSfx": {
|
||||
"__uuid__": "d0d5f5b7-dd0a-46cc-8957-9270fece9d32",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"stopSfx": {
|
||||
"__uuid__": "f0506909-3673-4420-99d8-c2e45c9b72a7",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"spinCurve": {
|
||||
"__id__": 144
|
||||
},
|
||||
|
@ -3324,7 +3340,6 @@
|
|||
"__id__": 0
|
||||
},
|
||||
"fileId": "b0CgrEZDdPP6qjRGc5LHCx",
|
||||
"instance": null,
|
||||
"targetOverrides": null
|
||||
"targetOverrides": []
|
||||
}
|
||||
]
|
|
@ -10994,6 +10994,18 @@
|
|||
"countDownLabel": {
|
||||
"__id__": 425
|
||||
},
|
||||
"collectSfx": {
|
||||
"__uuid__": "65a4db41-8617-4b1e-a465-e9aea50f5029",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"countDownSfx": {
|
||||
"__uuid__": "b03a6bbd-031f-451c-8a2c-cb6e6ec15464",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"readySfx": {
|
||||
"__uuid__": "2e5f5592-b662-4477-b4f0-e4d22682d0d8",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"gachas": [
|
||||
{
|
||||
"__id__": 430
|
||||
|
@ -18020,6 +18032,20 @@
|
|||
"_timeIcon": {
|
||||
"__id__": 621
|
||||
},
|
||||
"normalColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"warnColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_countDownSound": {
|
||||
"__uuid__": "c96f7bd8-69d7-4810-a6d4-3cfa61766b2c",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
|
|
|
@ -9858,7 +9858,7 @@
|
|||
"instance": {
|
||||
"__id__": 381
|
||||
},
|
||||
"targetOverrides": null,
|
||||
"targetOverrides": [],
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -10191,7 +10191,7 @@
|
|||
"instance": {
|
||||
"__id__": 405
|
||||
},
|
||||
"targetOverrides": null,
|
||||
"targetOverrides": [],
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -10490,6 +10490,18 @@
|
|||
"countDownLabel": {
|
||||
"__id__": 413
|
||||
},
|
||||
"collectSfx": {
|
||||
"__uuid__": "65a4db41-8617-4b1e-a465-e9aea50f5029",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"countDownSfx": {
|
||||
"__uuid__": "b03a6bbd-031f-451c-8a2c-cb6e6ec15464",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"readySfx": {
|
||||
"__uuid__": "2e5f5592-b662-4477-b4f0-e4d22682d0d8",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"gachas": [
|
||||
{
|
||||
"__id__": 418
|
||||
|
@ -16447,6 +16459,20 @@
|
|||
"_timeIcon": {
|
||||
"__id__": 578
|
||||
},
|
||||
"normalColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 255,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"warnColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_countDownSound": {
|
||||
"__uuid__": "c96f7bd8-69d7-4810-a6d4-3cfa61766b2c",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
|
|
|
@ -12346,7 +12346,7 @@
|
|||
"instance": {
|
||||
"__id__": 469
|
||||
},
|
||||
"targetOverrides": null,
|
||||
"targetOverrides": [],
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -12679,7 +12679,7 @@
|
|||
"instance": {
|
||||
"__id__": 493
|
||||
},
|
||||
"targetOverrides": null,
|
||||
"targetOverrides": [],
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -12978,6 +12978,18 @@
|
|||
"countDownLabel": {
|
||||
"__id__": 501
|
||||
},
|
||||
"collectSfx": {
|
||||
"__uuid__": "65a4db41-8617-4b1e-a465-e9aea50f5029",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"countDownSfx": {
|
||||
"__uuid__": "b03a6bbd-031f-451c-8a2c-cb6e6ec15464",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"readySfx": {
|
||||
"__uuid__": "2e5f5592-b662-4477-b4f0-e4d22682d0d8",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"gachas": [
|
||||
{
|
||||
"__id__": 506
|
||||
|
@ -18953,6 +18965,20 @@
|
|||
"_timeIcon": {
|
||||
"__id__": 667
|
||||
},
|
||||
"normalColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 255,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"warnColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_countDownSound": {
|
||||
"__uuid__": "c96f7bd8-69d7-4810-a6d4-3cfa61766b2c",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9997,7 +9997,7 @@
|
|||
"instance": {
|
||||
"__id__": 385
|
||||
},
|
||||
"targetOverrides": null,
|
||||
"targetOverrides": [],
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -10330,7 +10330,7 @@
|
|||
"instance": {
|
||||
"__id__": 409
|
||||
},
|
||||
"targetOverrides": null,
|
||||
"targetOverrides": [],
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
@ -10629,6 +10629,18 @@
|
|||
"countDownLabel": {
|
||||
"__id__": 417
|
||||
},
|
||||
"collectSfx": {
|
||||
"__uuid__": "65a4db41-8617-4b1e-a465-e9aea50f5029",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"countDownSfx": {
|
||||
"__uuid__": "b03a6bbd-031f-451c-8a2c-cb6e6ec15464",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"readySfx": {
|
||||
"__uuid__": "2e5f5592-b662-4477-b4f0-e4d22682d0d8",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
},
|
||||
"gachas": [
|
||||
{
|
||||
"__id__": 422
|
||||
|
@ -16586,6 +16598,20 @@
|
|||
"_timeIcon": {
|
||||
"__id__": 582
|
||||
},
|
||||
"normalColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 255,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"warnColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_countDownSound": {
|
||||
"__uuid__": "c96f7bd8-69d7-4810-a6d4-3cfa61766b2c",
|
||||
"__expectedType__": "cc.AudioClip"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -52,7 +52,7 @@ export class FloatingText extends Component {
|
|||
)
|
||||
.call(() => {
|
||||
this._sprite.spriteFrame = null;
|
||||
ObjectPool.release(this.node);
|
||||
this.node.releaseToPool();
|
||||
})
|
||||
.start();
|
||||
await Utils.delay(0.05);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { _decorator, Component, Node, Sprite } from 'cc';
|
||||
import { _decorator, AudioClip, Component, Node, Sprite } from 'cc';
|
||||
import GachaBase from '../Base/GachaBase';
|
||||
import SpineAnimationHandler from '../Base/SpineAnimationHandler';
|
||||
import AudioManager from '../Manager/AudioManager';
|
||||
import GachaManager from '../Manager/GachaManager';
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
@ -13,6 +14,12 @@ export default class FlipCard extends GachaBase {
|
|||
private spineRoot: Node;
|
||||
@property(Sprite)
|
||||
private cards: Sprite[] = [];
|
||||
@property(AudioClip)
|
||||
private showSfx: AudioClip;
|
||||
@property(AudioClip)
|
||||
private selectCardSfx: AudioClip;
|
||||
@property(AudioClip)
|
||||
private openCardSfx: AudioClip;
|
||||
|
||||
private _opened: boolean = false;
|
||||
|
||||
|
@ -21,15 +28,19 @@ export default class FlipCard extends GachaBase {
|
|||
switch (e.data.name) {
|
||||
case 'card1-active':
|
||||
this.cards[0].setNodeActive(true);
|
||||
AudioManager.playSfx(this.openCardSfx);
|
||||
break;
|
||||
case 'card2-active':
|
||||
this.cards[1].setNodeActive(true);
|
||||
AudioManager.playSfx(this.openCardSfx);
|
||||
break;
|
||||
case 'card3-active':
|
||||
this.cards[2].setNodeActive(true);
|
||||
AudioManager.playSfx(this.openCardSfx);
|
||||
break;
|
||||
case 'card4-active':
|
||||
this.cards[3].setNodeActive(true);
|
||||
AudioManager.playSfx(this.openCardSfx);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
@ -44,6 +55,7 @@ export default class FlipCard extends GachaBase {
|
|||
public async show(): Promise<void> {
|
||||
this.spineRoot.setActive(true);
|
||||
this.animationHandler.clearTracks();
|
||||
AudioManager.playSfx(this.showSfx);
|
||||
await this.animationHandler.setAnimationAsync('appear');
|
||||
this.animationHandler.addAnimation('idle', { loop: true });
|
||||
}
|
||||
|
@ -54,6 +66,7 @@ export default class FlipCard extends GachaBase {
|
|||
if (this.cards[+value - 1].node.active) return;
|
||||
const reward = await GachaManager.instance.getReward();
|
||||
if (reward) {
|
||||
AudioManager.playSfx(this.selectCardSfx);
|
||||
this.cards[+value - 1].spriteFrame = reward.icon;
|
||||
await this.animationHandler.setAnimationAsync(`card${value}-active`, { trackIndex: +value });
|
||||
const pos = this.cards[+value - 1].node.worldPosition.clone();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { _decorator, clamp01, Component, easing, game, Label, Node, Sprite, Vec3 } from 'cc';
|
||||
import { _decorator, AudioClip, clamp01, Component, easing, game, Label, Node, Sprite, Vec3 } from 'cc';
|
||||
import GachaBase from '../Base/GachaBase';
|
||||
import SpineAnimationHandler from '../Base/SpineAnimationHandler';
|
||||
import AudioManager from '../Manager/AudioManager';
|
||||
import GachaManager, { RewardConfig } from '../Manager/GachaManager';
|
||||
import Utils from '../Utilities';
|
||||
|
||||
|
@ -18,6 +19,8 @@ export default class FreeReward extends GachaBase {
|
|||
private rewardSprite: Sprite;
|
||||
@property(Label)
|
||||
private rewardLabel: Label;
|
||||
@property(AudioClip)
|
||||
private openSound: AudioClip;
|
||||
|
||||
private _opened: boolean = false;
|
||||
private _reward: RewardConfig;
|
||||
|
@ -49,10 +52,16 @@ export default class FreeReward extends GachaBase {
|
|||
this._opened = true;
|
||||
this._reward = await GachaManager.instance.getReward();
|
||||
if (this._reward) {
|
||||
AudioManager.playSfx(this.openSound);
|
||||
this.rewardSprite.spriteFrame = this._reward.icon;
|
||||
this.rewardLabel.string = 'x' + this._reward.quantity;
|
||||
await this.animationHandler.setAnimationAsync('open');
|
||||
this.rewardRoot.setActive(true);
|
||||
GachaManager.instance.showFloatingText(
|
||||
this._reward.quantity.toString(),
|
||||
this.node.worldPosition,
|
||||
this._reward.icon,
|
||||
);
|
||||
GachaManager.instance.gachaDone();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
_decorator,
|
||||
AudioClip,
|
||||
CCFloat,
|
||||
CCInteger,
|
||||
CCString,
|
||||
|
@ -14,6 +15,7 @@ import {
|
|||
} from 'cc';
|
||||
import GachaBase from '../Base/GachaBase';
|
||||
import SpineAnimationHandler from '../Base/SpineAnimationHandler';
|
||||
import AudioManager from '../Manager/AudioManager';
|
||||
import GachaManager, { RewardConfig } from '../Manager/GachaManager';
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
@ -49,6 +51,14 @@ export default class LuckyWheel extends GachaBase {
|
|||
private wheelBoneName: string = '';
|
||||
@property(CCInteger)
|
||||
private speed: number = 1;
|
||||
@property(AudioClip)
|
||||
private showSfx: AudioClip;
|
||||
@property(AudioClip)
|
||||
private btnSfx: AudioClip;
|
||||
@property(AudioClip)
|
||||
private spinSfx: AudioClip;
|
||||
@property(AudioClip)
|
||||
private stopSfx: AudioClip;
|
||||
@property(RealCurve)
|
||||
private spinCurve: RealCurve = new RealCurve();
|
||||
@property(RewardDisplay)
|
||||
|
@ -62,6 +72,7 @@ export default class LuckyWheel extends GachaBase {
|
|||
private _timer: number = 0;
|
||||
private _timeSpin: number = 0;
|
||||
private _maxAngle: number = 0;
|
||||
private _preAngle: number = 0;
|
||||
private _allCards: RewardCard[];
|
||||
private _random: number;
|
||||
|
||||
|
@ -83,8 +94,13 @@ export default class LuckyWheel extends GachaBase {
|
|||
const angle = this._maxAngle * this.spinCurve.evaluate(this._timer / this._timeSpin);
|
||||
this._wheel.rotation = this._targetAngle + angle;
|
||||
this._wheel.update();
|
||||
if (Math.abs(this._preAngle - angle) >= 36) {
|
||||
this._preAngle = angle;
|
||||
AudioManager.playSfx(this.spinSfx);
|
||||
}
|
||||
if (this._timer >= this._timeSpin) {
|
||||
this._spinning = false;
|
||||
AudioManager.playSfx(this.stopSfx);
|
||||
GachaManager.instance.showFloatingText(
|
||||
this._allCards[this._random].reward.quantity.toString(),
|
||||
this.node.worldPosition,
|
||||
|
@ -106,19 +122,21 @@ export default class LuckyWheel extends GachaBase {
|
|||
public async show(): Promise<void> {
|
||||
this.setReward();
|
||||
this.spineRoot.setActive(true);
|
||||
AudioManager.playSfx(this.showSfx);
|
||||
await this.animationHandler.setAnimationAsync('appear');
|
||||
|
||||
this.animationHandler.addAnimation('idle', { loop: true });
|
||||
}
|
||||
|
||||
public async spin() {
|
||||
if (this._spinning) return;
|
||||
this._spinning = true;
|
||||
AudioManager.playSfx(this.btnSfx);
|
||||
this._random = this._allCards.getRandomIndex();
|
||||
this.animationHandler.clearTrack(0);
|
||||
this._targetAngle = -(360 / this.rewardDisplay.length) * this._random + this.offsetAngle;
|
||||
this._timer = 0;
|
||||
this._timeSpin = randomRangeInt(10, 15);
|
||||
this._maxAngle = 360 * this._timeSpin;
|
||||
this._preAngle = this._maxAngle;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ export default class Gizmos3D {
|
|||
|
||||
public static drawDashLineList(node: Node, points: Vec3[], close: boolean = false) {
|
||||
const debugNode = this.getDebugNode(node);
|
||||
debugNode?.drawLineList(points, close);
|
||||
debugNode?.drawDashLineList(points, close);
|
||||
}
|
||||
|
||||
public static drawCircle(node: Node, center: Vec3, radius: number, rot: Vec3 = Vec3.ZERO, segments: number = 32) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
_decorator,
|
||||
AudioClip,
|
||||
CCInteger,
|
||||
CCString,
|
||||
clamp01,
|
||||
|
@ -24,6 +25,7 @@ import FloatingTextFactory from '../Factory/FloatingTextFactory';
|
|||
import P4PSDK from '../P4PSDK';
|
||||
import Singleton from '../Singleton';
|
||||
import Utils from '../Utilities';
|
||||
import AudioManager from './AudioManager';
|
||||
import { EventManger } from './EventManger';
|
||||
import { GameManager } from './GameManager';
|
||||
import { SpawnObjectManager } from './SpawnObjectManager';
|
||||
|
@ -78,6 +80,14 @@ export default class GachaManager extends Singleton<GachaManager>() {
|
|||
private floatingScoreFactory: FloatingTextFactory;
|
||||
@property(Label)
|
||||
private countDownLabel: Label;
|
||||
|
||||
@property(AudioClip)
|
||||
private collectSfx: AudioClip;
|
||||
@property(AudioClip)
|
||||
private countDownSfx: AudioClip;
|
||||
@property(AudioClip)
|
||||
private readySfx: AudioClip;
|
||||
|
||||
@property(Gacha)
|
||||
private gachas: Gacha[] = [];
|
||||
@property(RewardConfig)
|
||||
|
@ -123,6 +133,7 @@ export default class GachaManager extends Singleton<GachaManager>() {
|
|||
|
||||
public showFloatingText(text: string, position: Vec3, icon: SpriteFrame) {
|
||||
const floatingText = this.floatingScoreFactory.create(this.node);
|
||||
AudioManager.playSfx(this.collectSfx);
|
||||
floatingText.show(`+${text}`, position, 3, 1, icon);
|
||||
}
|
||||
|
||||
|
@ -159,6 +170,7 @@ export default class GachaManager extends Singleton<GachaManager>() {
|
|||
let count = 3;
|
||||
while (count >= 0) {
|
||||
this.countDownLabel.setString(count == 0 ? 'Ready' : count);
|
||||
AudioManager.playSfx(count == 0 ? this.readySfx : this.countDownSfx);
|
||||
count--;
|
||||
await Utils.delay(0.5);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,10 @@ export class TimeUI extends Component {
|
|||
private _fill: Sprite;
|
||||
@property({ type: Node, visible: true })
|
||||
private _timeIcon: Node;
|
||||
@property(Color)
|
||||
private normalColor: Color = new Color();
|
||||
@property(Color)
|
||||
private warnColor: Color = new Color();
|
||||
|
||||
@property({ type: AudioClip, visible: true })
|
||||
private _countDownSound: AudioClip;
|
||||
|
@ -41,7 +45,7 @@ export class TimeUI extends Component {
|
|||
case GameState.Playing:
|
||||
AudioManager.stopSfx(this._countDownSound);
|
||||
Tween.stopAllByTarget(this._timeIcon);
|
||||
this._fill.color = Color.GREEN;
|
||||
this._fill.color = this.normalColor;
|
||||
this._timeLabel.color = Color.WHITE;
|
||||
break;
|
||||
case GameState.GameOver:
|
||||
|
@ -62,7 +66,7 @@ export class TimeUI extends Component {
|
|||
private onWarningTime(warning: boolean) {
|
||||
if (warning) {
|
||||
AudioManager.playSfx(this._countDownSound, { loop: true });
|
||||
this._fill.color = Color.RED;
|
||||
this._fill.color = this.warnColor;
|
||||
tween(this._timeIcon)
|
||||
.to(0.05, { position: new Vec3(3.117, 3.177) })
|
||||
.to(0.08, { scale: new Vec3(0.9, 1.1) })
|
||||
|
@ -78,7 +82,7 @@ export class TimeUI extends Component {
|
|||
} else {
|
||||
AudioManager.stopSfx(this._countDownSound);
|
||||
Tween.stopAllByTarget(this._timeIcon);
|
||||
this._fill.color = Color.GREEN;
|
||||
this._fill.color = this.normalColor;
|
||||
this._timeLabel.color = Color.WHITE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "399eabc2-4bee-43d8-ae89-fb8e93e61de5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "239a95de-d63b-48eb-be24-28ebec455f99",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "23a142a8-835d-4f43-8c3a-acbfadc56c23",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "2b5160a6-db5c-4925-9cb9-620c46695762",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "4d36d11c-3612-4f53-a3fd-d3b55b73422c",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "65a4db41-8617-4b1e-a465-e9aea50f5029",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "b03a6bbd-031f-451c-8a2c-cb6e6ec15464",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "2e5f5592-b662-4477-b4f0-e4d22682d0d8",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "d03f0c89-dd68-4d13-af73-918b39cf7953",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "d0d5f5b7-dd0a-46cc-8957-9270fece9d32",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "f0506909-3673-4420-99d8-c2e45c9b72a7",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"ver": "1.0.0",
|
||||
"importer": "audio-clip",
|
||||
"imported": true,
|
||||
"uuid": "37e56b7e-d9f1-46d7-8df3-21766bd1c253",
|
||||
"files": [
|
||||
".json",
|
||||
".mp3"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"downloadMode": 0
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue