2026-06-18 많은 플레이어 수정사항

This commit is contained in:
2026-06-18 15:07:21 +09:00
parent dff151c5f0
commit 67c2b2c179
30 changed files with 543 additions and 22 deletions

View File

@@ -0,0 +1,56 @@
using TMPro;
using UnityEngine;
// 시작 버튼 직후 VR 준비용 카운트다운(5..1, GO!) 표시. RhythmManager 이벤트만 구독하고 표시만 한다.
public class RhythmCountdownHud : MonoBehaviour
{
[SerializeField] private RhythmManager _manager;
[SerializeField] private GameObject _root; // 카운트다운 표시 루트 (카운트 동안만 켬)
[SerializeField] private TMP_Text _countText; // 큰 숫자 / GO! 텍스트
[SerializeField] private string _goText = "GO!";
[SerializeField] private float _goHideDelay = 0.6f; // GO! 표시 후 자동으로 숨기는 시간(초)
private void Awake()
{
if (_root != null) _root.SetActive(false); // 시작 전엔 숨김
}
private void OnEnable()
{
if (_manager == null) return;
_manager.OnCountdownStarted += HandleStarted;
_manager.OnCountdownTick += HandleTick;
_manager.OnCountdownFinished += HandleFinished;
}
private void OnDisable()
{
if (_manager == null) return;
_manager.OnCountdownStarted -= HandleStarted;
_manager.OnCountdownTick -= HandleTick;
_manager.OnCountdownFinished -= HandleFinished;
}
private void HandleStarted()
{
CancelInvoke(nameof(Hide));
if (_root != null) _root.SetActive(true); // 카운트다운 시작 시 표시
}
private void HandleTick(int secondsLeft)
{
if (_countText != null) _countText.text = secondsLeft.ToString();
}
private void HandleFinished()
{
if (_countText != null) _countText.text = _goText; // GO! 잠깐 표시 후 숨김
CancelInvoke(nameof(Hide));
Invoke(nameof(Hide), _goHideDelay);
}
private void Hide()
{
if (_root != null) _root.SetActive(false);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2188bb7711648514a804e0581ef52b50