17 lines
425 B
TypeScript
17 lines
425 B
TypeScript
import { _decorator, Component, Label, ParticleSystem } from "cc";
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('DamageText')
|
|
export class DamageText extends Component {
|
|
@property(Label)
|
|
label: Label = null!;
|
|
|
|
@property(ParticleSystem)
|
|
critEffect: ParticleSystem = null!;
|
|
|
|
playEffect(isCrit: boolean) {
|
|
if (isCrit && this.critEffect) {
|
|
this.critEffect.play();
|
|
}
|
|
}
|
|
}
|