diff --git a/Assets/_Project/Scenes/Levels/9Player.unity b/Assets/_Project/Scenes/Levels/9Player.unity index 90db615..0fcac59 100644 --- a/Assets/_Project/Scenes/Levels/9Player.unity +++ b/Assets/_Project/Scenes/Levels/9Player.unity @@ -2253,7 +2253,7 @@ MonoBehaviour: m_EditorClassIdentifier: Assembly-CSharp::TD.Audio.AudioManager categories: - category: 0 - maxVoices: 4 + maxVoices: 6 volume: 0.5 - category: 1 maxVoices: 4 diff --git a/Assets/_Project/Scripts/Audio/AudioCategory.cs b/Assets/_Project/Scripts/Audio/AudioCategory.cs index 9a446aa..539e9ba 100644 --- a/Assets/_Project/Scripts/Audio/AudioCategory.cs +++ b/Assets/_Project/Scripts/Audio/AudioCategory.cs @@ -1,5 +1,5 @@ // Assets/_Project/Scripts/Audio/AudioCategory.cs namespace TD.Audio { - public enum AudioCategory { TowerFire, EnemyHitDeath, UI } + public enum AudioCategory { Combat, EnemyHitDeath, UI } } diff --git a/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs b/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs index 3334523..eddc323 100644 --- a/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs +++ b/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs @@ -38,7 +38,7 @@ namespace TD.Combat private void HandleAreaFired(Vector3[] positions) { - AudioManager.Instance?.Play(fireSound.clip, AudioCategory.TowerFire, fireSound.RandomPitch(), fireSound.volume); + AudioManager.Instance?.Play(fireSound.clip, AudioCategory.Combat, fireSound.RandomPitch(), fireSound.volume); } } } diff --git a/Assets/_Project/Scripts/Gameplay/BuilderInputController.cs b/Assets/_Project/Scripts/Gameplay/BuilderInputController.cs index ce1e258..72bd7c3 100644 --- a/Assets/_Project/Scripts/Gameplay/BuilderInputController.cs +++ b/Assets/_Project/Scripts/Gameplay/BuilderInputController.cs @@ -156,7 +156,22 @@ namespace TD.Gameplay { HUDController.Instance?.ToggleBuffMenu(); } - + + // Tab: select the builder, or (if already selected) recenter the camera on it. + if (keyboard != null && keyboard.tabKey.wasPressedThisFrame + && !HUDController.IsTextInputActive) + { + var selection = SelectionState.Instance; + if (selection != null && selection.IsSelected(builder)) + { + HUDController.Instance?.CenterCameraOnSelection(); + } + else + { + selection?.Select(builder); + } + } + if (pointerOverHud) return; if (!mouse.rightButton.wasPressedThisFrame) return; diff --git a/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs b/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs index b5dae1f..5f34a1c 100644 --- a/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs +++ b/Assets/_Project/Scripts/Gameplay/BuilderSpells/FireballSpellDefinition.cs @@ -65,7 +65,7 @@ namespace TD.Gameplay.BuilderSpells Destroy(Instantiate(impactVfxPrefab, targetPoint, Quaternion.identity), impactVfxLifetime); if (impactSound.clip != null) - AudioManager.Instance?.Play(impactSound.clip, AudioCategory.TowerFire, + AudioManager.Instance?.Play(impactSound.clip, AudioCategory.Combat, impactSound.RandomPitch(), impactSound.volume); } } diff --git a/Assets/_Project/Scripts/UI/HUDController.cs b/Assets/_Project/Scripts/UI/HUDController.cs index e63a097..7d17387 100644 --- a/Assets/_Project/Scripts/UI/HUDController.cs +++ b/Assets/_Project/Scripts/UI/HUDController.cs @@ -1642,7 +1642,14 @@ namespace TD.UI // WC3 / SC2 convention: clicking the portrait recenters the camera on // whoever is selected. Zoom is preserved (CameraController.JumpTo only // moves the pivot). No-op when nothing is selected or the camera isn't wired. - private void OnPortraitClicked(ClickEvent evt) + private void OnPortraitClicked(ClickEvent evt) => CenterCameraOnSelection(); + + /// + /// Recenters the camera on the current selection (same behavior as clicking the + /// portrait). No-op when nothing is selected or the camera isn't wired. Also used + /// by the Tab hotkey (select-builder-then-focus) in BuilderInputController. + /// + public void CenterCameraOnSelection() { var sel = SelectionState.Instance?.SelectedObject; if (sel == null) return;