Adding tons of new functionality
Decals, ghost textures, placement functionality, builder stub ins, a new camera system, and more.
This commit is contained in:
parent
56dc775c68
commit
a63cce53e2
54 changed files with 4817 additions and 238 deletions
|
|
@ -143,6 +143,25 @@ namespace TD.Gameplay
|
|||
currentGold.Value += amount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server-side entry point for deducting gold (tower placement, other costs).
|
||||
/// Direct call — not Rpc-wrapped — because deductions always originate from
|
||||
/// server-authoritative validation (e.g., <c>TowerPlacementManager</c> after
|
||||
/// all checks have passed). Clamps to zero; gold cannot go negative.
|
||||
/// </summary>
|
||||
public void DeductGold(int amount)
|
||||
{
|
||||
if (!IsServer)
|
||||
{
|
||||
Debug.LogError("[PlayerGoldManager] DeductGold called on a client. " +
|
||||
"Only server code should call this directly.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (amount <= 0) return;
|
||||
currentGold.Value = Mathf.Max(0, currentGold.Value - amount);
|
||||
}
|
||||
|
||||
// --- Server-side Rpc ---------------------------------------------
|
||||
|
||||
// InvokePermission = Owner: only the client that owns this NetworkObject
|
||||
|
|
@ -175,4 +194,4 @@ namespace TD.Gameplay
|
|||
currentGold.Value -= amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue