2026-06-19 UI, UI로직

This commit is contained in:
skrwns304@gmail.com
2026-06-19 14:27:40 +09:00
parent b751a9ed66
commit b1e85a5b89
549 changed files with 18058 additions and 20 deletions

View File

@@ -0,0 +1,52 @@
using UnityEngine;
using UnityEngine.InputSystem;
public class RhythmInputHandler : MonoBehaviour
{
[Header("Reference")]
[SerializeField] private RhythmGameManager rhythmGameManager;
[Header("Keyboard Test")]
[SerializeField] private bool allowKeyboardTest = true;
[SerializeField] private Key testKey = Key.Space;
[Header("Auto Find")]
[SerializeField] private bool autoFindManager = true;
private void Awake()
{
if (rhythmGameManager == null && autoFindManager)
rhythmGameManager = FindFirstObjectByType<RhythmGameManager>();
}
private void Update()
{
if (!allowKeyboardTest)
return;
if (Keyboard.current == null)
return;
if (Keyboard.current[testKey].wasPressedThisFrame)
SubmitHit();
}
public void OnHit(InputValue value)
{
if (value.isPressed)
SubmitHit();
}
public void SubmitHit()
{
if (rhythmGameManager == null)
return;
rhythmGameManager.SubmitHit();
}
public void SetManager(RhythmGameManager manager)
{
rhythmGameManager = manager;
}
}