pinball/assets/_Game/Scripts/Booster/SecretBox.ts

26 lines
765 B
TypeScript
Raw Normal View History

2024-06-10 23:38:06 -07:00
import { _decorator, Component, game, Node, TweenSystem } from 'cc';
2024-06-10 21:35:13 -07:00
import BoosterType from '../Enum/BoosterType';
import GachaManager, { GachaType } from '../Manager/GachaManager';
import { BoosterBase } from './BoosterBase';
const { ccclass, property } = _decorator;
@ccclass('SecretBoxBooster')
export default class SecretBoxBooster extends BoosterBase {
2024-06-12 04:48:19 -07:00
@property({ type: BoosterType })
public readonly type: BoosterType;
2024-06-10 23:38:06 -07:00
2024-06-10 21:35:13 -07:00
@property({ type: GachaType })
private gachaType: GachaType;
2024-06-10 23:38:06 -07:00
public collect(collector: Node) {
super.collect(collector);
2024-06-10 21:35:13 -07:00
GachaManager.instance.show(this.gachaType, 1.5);
}
2024-06-10 23:38:06 -07:00
public tick(dt: number): void {
super.tick(dt);
TweenSystem.instance.update(game.deltaTime);
}
2024-06-10 21:35:13 -07:00
}