tab once selects builder, tab twice focuses builder
This commit is contained in:
parent
826d7b5037
commit
fe2c59d326
6 changed files with 28 additions and 6 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue