Updates to spells, HUD, Gold, and Camera Controls. New sound effects!

This commit is contained in:
Matt F 2026-07-18 18:12:56 -07:00
parent 689fe7be88
commit a33d951abd
27 changed files with 578 additions and 68 deletions

View file

@ -28,6 +28,14 @@ namespace TD.Gameplay.BuilderSpells
[Min(0f)]
[SerializeField] private float impactVfxLifetime = 2f;
[Tooltip("Seconds from cast until the falling fireball reaches the ground. Damage and the " +
"impact sound are held until then so they land with the visual — SET THIS TO MATCH " +
"the meteor VFX's fall time. 0 = everything resolves instantly on cast.")]
[Min(0f)]
[SerializeField] private float impactDelay = 0.8f;
public override float ImpactDelay => impactDelay;
[Header("Impact Sound")]
[Tooltip("Sound played on every peer when this spell resolves successfully. Same " +
"SoundConfig struct TowerBuiltSound uses — reuse a tower's clip directly if " +
@ -59,11 +67,16 @@ namespace TD.Gameplay.BuilderSpells
return hitAny;
}
public override void ClientPlayVfx(Vector3 targetPoint)
public override void ClientSpawnVfx(Vector3 targetPoint)
{
// The meteor VFX plays its full fall-and-crash animation from here; it reaches the
// ground after ImpactDelay, which is when ClientPlayImpact and ServerCast fire.
if (impactVfxPrefab != null)
Destroy(Instantiate(impactVfxPrefab, targetPoint, Quaternion.identity), impactVfxLifetime);
}
public override void ClientPlayImpact(Vector3 targetPoint)
{
if (impactSound.clip != null)
AudioManager.Instance?.Play(impactSound.clip, AudioCategory.Combat,
impactSound.RandomPitch(), impactSound.volume);