some updates
This commit is contained in:
@@ -143,6 +143,7 @@ public class InputManager : MonoBehaviour
|
||||
/// Begin holding a track (0-4). Called by keyboard Update on key-down and by touch
|
||||
/// regions on pointer-down. Sets the held-state table, raises OnKeyPressed with the
|
||||
/// track's bound key so event-driven tap notes keep working, and updates lane visuals.
|
||||
/// Always fires OnKeyPressed to allow rapid same-track taps even when held.
|
||||
/// </summary>
|
||||
public void PressTrack(int index)
|
||||
{
|
||||
@@ -150,12 +151,14 @@ public class InputManager : MonoBehaviour
|
||||
bool wasHeld = trackHeldCount[index] > 0;
|
||||
trackHeldCount[index]++;
|
||||
|
||||
if (wasHeld) return; // already held; avoid duplicate press events
|
||||
|
||||
// Always fire tap judgment pulse, even if already held (fixes rapid same-track taps)
|
||||
KeyCode key = cachedKeys[index];
|
||||
if (key != KeyCode.None)
|
||||
OnKeyPressed?.Invoke(key);
|
||||
|
||||
// Only update visuals on the first press (0→1 transition)
|
||||
if (wasHeld) return;
|
||||
|
||||
if (laneSprites != null && index < laneSprites.Length)
|
||||
SetSpriteAlpha(laneSprites[index], pressedAlpha);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user