Compare commits
No commits in common. "90fd1c23d3054497f0947165f7be63ac7f1cce32" and "1d03689dadd20a202a8d64b48300ee32e64b7950" have entirely different histories.
90fd1c23d3
...
1d03689dad
1 changed files with 3 additions and 13 deletions
|
|
@ -414,7 +414,7 @@ namespace TD.Gameplay
|
||||||
// PlayerZoneVolume (so OwnerGrid[spawnerTile] = None).
|
// PlayerZoneVolume (so OwnerGrid[spawnerTile] = None).
|
||||||
var spawner = zone.Spawners[0];
|
var spawner = zone.Spawners[0];
|
||||||
(float xHalf, float zHalf) = ComputeSpawnerHalfExtents(spawner.TileArea);
|
(float xHalf, float zHalf) = ComputeSpawnerHalfExtents(spawner.TileArea);
|
||||||
SpawnEnemy(def, spawner.TilePosition, zone.Owner, xHalf, zHalf, held, spawner.Facing);
|
SpawnEnemy(def, spawner.TilePosition, zone.Owner, xHalf, zHalf, held);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -440,8 +440,7 @@ namespace TD.Gameplay
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SpawnEnemy(EnemyDefinition def, Vector2Int spawnerTile, PlayerSlot ownerSlot,
|
private void SpawnEnemy(EnemyDefinition def, Vector2Int spawnerTile, PlayerSlot ownerSlot,
|
||||||
float xHalfExtent = 0f, float zHalfExtent = 0f, bool held = false,
|
float xHalfExtent = 0f, float zHalfExtent = 0f, bool held = false)
|
||||||
Direction facing = Direction.South)
|
|
||||||
{
|
{
|
||||||
if (def.EnemyPrefab == null)
|
if (def.EnemyPrefab == null)
|
||||||
{
|
{
|
||||||
|
|
@ -461,19 +460,10 @@ namespace TD.Gameplay
|
||||||
if (def.IsFlying)
|
if (def.IsFlying)
|
||||||
spawnPos.y += def.FlightHeight;
|
spawnPos.y += def.FlightHeight;
|
||||||
|
|
||||||
float yaw = facing switch
|
|
||||||
{
|
|
||||||
Direction.North => 0f,
|
|
||||||
Direction.East => 90f,
|
|
||||||
Direction.South => 180f,
|
|
||||||
Direction.West => 270f,
|
|
||||||
_ => 0f,
|
|
||||||
};
|
|
||||||
|
|
||||||
var go = Instantiate(
|
var go = Instantiate(
|
||||||
def.EnemyPrefab,
|
def.EnemyPrefab,
|
||||||
spawnPos,
|
spawnPos,
|
||||||
Quaternion.Euler(0f, yaw, 0f));
|
Quaternion.identity);
|
||||||
|
|
||||||
var health = go.GetComponent<EnemyHealth>();
|
var health = go.GetComponent<EnemyHealth>();
|
||||||
var movement = go.GetComponent<EnemyMovement>();
|
var movement = go.GetComponent<EnemyMovement>();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue