building falling from orbit sound

This commit is contained in:
Ian Woods 2026-07-06 23:56:45 -07:00
parent ffe38ed8b1
commit 4a37d3747c
7 changed files with 109 additions and 1 deletions

View file

@ -184,6 +184,20 @@ namespace TD.Gameplay
return Mathf.Clamp01((currentRunElapsed + accumulatedConstructionTime.Value) / bt);
}
/// <summary>
/// Returns seconds remaining until construction completes. Safe to call on any
/// client. Returns 0 while Queued (no timer running yet) or once complete.
/// </summary>
public float ComputeRemainingSeconds()
{
float bt = buildTime.Value;
if (bt <= 0f) return 0f;
float currentRunElapsed = constructionStartServerTime.Value > 0f
? (float)NetworkManager.Singleton.ServerTime.Time - constructionStartServerTime.Value
: 0f;
return Mathf.Max(0f, bt - (currentRunElapsed + accumulatedConstructionTime.Value));
}
// ----- ISelectable ------------------------------------------------
/// <summary>Name shown in the HUD portrait. Pulls from the resolved