26 lines
765 B
TypeScript
26 lines
765 B
TypeScript
import { _decorator, Component, game, Node, TweenSystem } from 'cc';
|
|
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 {
|
|
@property({ type: BoosterType })
|
|
public readonly type: BoosterType;
|
|
|
|
@property({ type: GachaType })
|
|
private gachaType: GachaType;
|
|
|
|
public collect(collector: Node) {
|
|
super.collect(collector);
|
|
GachaManager.instance.show(this.gachaType, 1.5);
|
|
}
|
|
|
|
public tick(dt: number): void {
|
|
super.tick(dt);
|
|
TweenSystem.instance.update(game.deltaTime);
|
|
}
|
|
}
|