Adding tons of new functionality

Decals, ghost textures, placement functionality, builder stub ins, a new camera system,  and more.
This commit is contained in:
Matt F 2026-05-04 00:01:30 -07:00
parent 56dc775c68
commit a63cce53e2
54 changed files with 4817 additions and 238 deletions

View file

@ -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;
}
}
}
}