Merge branch 'main' of https://git.marlboro-bc.duckdns.org/yeahweregames/UnityTowerDefense
This commit is contained in:
commit
04d4167db6
4 changed files with 76 additions and 25 deletions
|
|
@ -76,6 +76,7 @@ namespace TD.Gameplay
|
|||
// possible if pathing is dynamic).
|
||||
private bool hasLeakedOriginZone;
|
||||
private EnemyStatus status;
|
||||
private EnemyHealth health;
|
||||
private bool hasReachedGoal;
|
||||
private bool wasStuck; // dedupes the "no path" warning
|
||||
|
||||
|
|
@ -126,6 +127,7 @@ namespace TD.Gameplay
|
|||
public override void OnNetworkSpawn()
|
||||
{
|
||||
status = GetComponent<EnemyStatus>();
|
||||
health = GetComponent<EnemyHealth>();
|
||||
|
||||
// Randomize the walk-cycle phase on every peer independently. Animations
|
||||
// are purely visual and not replicated, so each client picks its own offset —
|
||||
|
|
@ -182,6 +184,7 @@ namespace TD.Gameplay
|
|||
private void Update()
|
||||
{
|
||||
if (!IsServer) return;
|
||||
if (health != null && health.IsHeld) return;
|
||||
if (remainingPath.Count == 0) return;
|
||||
|
||||
float effectiveSpeed = moveSpeed * (status != null ? status.GetSpeedMultiplier() : 1f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue