more changes, i guess
This commit is contained in:
parent
8170f8d5e0
commit
53f2a3e8a8
1 changed files with 9 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue