mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-18 19:57:59 +07:00
Add unitSpawnEvent (#5876)
This commit is contained in:
@ -127,3 +127,4 @@ WilloIzCitron
|
|||||||
SAMBUYYA
|
SAMBUYYA
|
||||||
genNAowl
|
genNAowl
|
||||||
TranquillyUnpleasant
|
TranquillyUnpleasant
|
||||||
|
Darkness6030
|
||||||
|
@ -196,6 +196,7 @@ public class WaveSpawner{
|
|||||||
unit.apply(StatusEffects.invincible, 60f);
|
unit.apply(StatusEffects.invincible, 60f);
|
||||||
unit.add();
|
unit.add();
|
||||||
|
|
||||||
|
Events.fire(new UnitSpawnEvent(unit));
|
||||||
Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type);
|
Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,6 +428,15 @@ public class EventType{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Called when a unit is spawned by wave. */
|
||||||
|
public static class UnitSpawnEvent{
|
||||||
|
public final Unit unit;
|
||||||
|
|
||||||
|
public UnitSpawnEvent(Unit unit) {
|
||||||
|
this.unit = unit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Called when a unit is dumped from any payload block. */
|
/** Called when a unit is dumped from any payload block. */
|
||||||
public static class UnitUnloadEvent{
|
public static class UnitUnloadEvent{
|
||||||
public final Unit unit;
|
public final Unit unit;
|
||||||
|
Reference in New Issue
Block a user