enemies split, but it needs a bit of work
This commit is contained in:
parent
8714885efa
commit
11ad19992d
10 changed files with 111 additions and 3 deletions
|
|
@ -28,12 +28,17 @@ namespace TD.Gameplay.EnemyAbilities
|
|||
|
||||
public override void ServerOnDeath(EnemyAbility instance, EnemyHealth health)
|
||||
{
|
||||
Debug.Log($"[SplitOnDeathAbility] ServerOnDeath fired for {instance.name}. " +
|
||||
$"SplitInto={(SplitInto != null ? SplitInto.name : "null")}, " +
|
||||
$"WaveManager.Instance={(WaveManager.Instance != null)}");
|
||||
|
||||
if (SplitInto == null) return;
|
||||
|
||||
var movement = instance.GetComponent<EnemyMovement>();
|
||||
var atTile = GridCoordinates.WorldToGrid(instance.transform.position);
|
||||
var ownerSlot = movement != null ? movement.OriginZone : PlayerSlot.None;
|
||||
|
||||
Debug.Log($"[SplitOnDeathAbility] Spawning {SplitCount}x {SplitInto.name} at tile {atTile}.");
|
||||
WaveManager.Instance?.ServerSpawnSplitEnemies(SplitInto, SplitCount, atTile, ownerSlot, ScatterRadius);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue