mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-04-22 14:59:03 +00:00
14 lines
593 B
TypeScript
14 lines
593 B
TypeScript
import { ProjectileCollision } from "../Projectile/ProjectileCollision";
|
|
import { Enemy } from "../Unit/Enemy/Enemy";
|
|
import { HaloProjectileLauncher } from "../Unit/Player/ProjectileLauncher/Halo/HaloProjectileLauncher";
|
|
|
|
export class PlayerProjectileCollisionSystem {
|
|
public constructor(haloLauncher: HaloProjectileLauncher) {
|
|
haloLauncher.ProjectileCollisionEvent.on(this.onProjectileCollision, this);
|
|
}
|
|
|
|
private onProjectileCollision(projectileCollision: ProjectileCollision): void {
|
|
projectileCollision.otherCollider.getComponent(Enemy).dealDamage(1);
|
|
}
|
|
}
|