删除文件 Assets/scripts/gamePlay_gameplay/InputManager.cs
This commit is contained in:
@@ -1,26 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
public class InputManager : MonoBehaviour
|
|
||||||
{
|
|
||||||
public static event Action<KeyCode> OnKeyPressed;
|
|
||||||
public static event Action<KeyCode> OnKeyReleased;
|
|
||||||
|
|
||||||
private void Update()
|
|
||||||
{
|
|
||||||
foreach (string color in new string[] { "red", "green", "yellow", "purple", "blue" })
|
|
||||||
{
|
|
||||||
KeyCode key = KeyBindingManager.GetKeyForColor(color);
|
|
||||||
if (key == KeyCode.None) continue;
|
|
||||||
|
|
||||||
if (Input.GetKeyDown(key))
|
|
||||||
{
|
|
||||||
OnKeyPressed?.Invoke(key);
|
|
||||||
// 调用 JudgeManager 统一判断最早的音符
|
|
||||||
JudgeManager.Instance.JudgeEarliestNote(key);
|
|
||||||
}
|
|
||||||
if (Input.GetKeyUp(key))
|
|
||||||
OnKeyReleased?.Invoke(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user