first-roguelike-elements #3

Merged
ian merged 7 commits from first-roguelike-elements into main 2026-06-23 20:39:28 -07:00
Showing only changes of commit 53f2a3e8a8 - Show all commits

View file

@ -1,10 +1,13 @@
// Assets/_Project/Scripts/Combat/TowerCombat.cs
using System;
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
using TD.Core;
using TD.Gameplay;
using TD.Towers;
using Unity.Netcode;
using UnityEngine;
using Object = UnityEngine.Object;
namespace TD.Combat
{
@ -75,17 +78,17 @@ namespace TD.Combat
/// fired in <see cref="OnNetworkSpawn"/> for late-joining clients so visual
/// consumers always initialise from the correct state.
/// </summary>
public event System.Action<NetworkObjectReference> OnTargetAcquired;
public event Action<NetworkObjectReference> OnTargetAcquired;
/// <summary>Fired locally on ALL peers when the tower loses its target.</summary>
public event System.Action OnTargetLost;
public event Action OnTargetLost;
/// <summary>
/// Fired locally on ALL peers each time the tower attacks.
/// Argument is the world-space position of the primary target at the moment
/// of fire — use it to aim muzzle flash, spawn a tracer, etc.
/// </summary>
public event System.Action<Vector3> OnFire;
public event Action<Vector3> OnFire;
// ----- NGO lifecycle -----------------------------------------------
@ -143,7 +146,7 @@ namespace TD.Combat
if (currentTarget == null) return;
bool dead = currentTarget.IsDead;
bool destroyed = (currentTarget as UnityEngine.Object) == null;
bool destroyed = (currentTarget as Object) == null;
bool outOfRange = Vector3.Distance(
transform.position,
currentTarget.transform.position) > def.Range;