feat: update song selection, score UI, and song creator features
- SongSelectManager/SongDetailPanel: 곡 선택 및 상세 패널 개선 - SongCreatorManager: 곡 생성 기능 추가 - FinalScoreLabel/ScoreManager: 결과 화면 점수 UI 업데이트 - MarqueeText: 마퀴 텍스트 컴포넌트 개선 - NoteData/SongController: 노트 데이터 및 컨트롤러 보완 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,12 +5,13 @@ using UnityEngine;
|
||||
[RequireComponent(typeof(TMP_Text))]
|
||||
public class MarqueeText : MonoBehaviour
|
||||
{
|
||||
public float speed = 35f;
|
||||
public float pauseStart = 1.5f;
|
||||
public float pauseEnd = 0.6f;
|
||||
public float speed = 14f;
|
||||
public float pauseStart = 1.8f;
|
||||
public float pauseEnd = 0.9f;
|
||||
|
||||
private TMP_Text _label;
|
||||
private RectTransform _rect;
|
||||
private Coroutine _scrollRoutine;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -20,7 +21,22 @@ public class MarqueeText : MonoBehaviour
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
yield return null; // layout 완료 후 실행
|
||||
yield return null;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
StopScrolling();
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
if (!isActiveAndEnabled || _label == null || _rect == null || transform.parent == null)
|
||||
return;
|
||||
|
||||
StopScrolling();
|
||||
SetX(0f);
|
||||
|
||||
_label.ForceMeshUpdate();
|
||||
float textW = _label.preferredWidth;
|
||||
@@ -28,7 +44,7 @@ public class MarqueeText : MonoBehaviour
|
||||
float dist = textW - containerW;
|
||||
|
||||
if (dist > 1f)
|
||||
StartCoroutine(ScrollLoop(dist));
|
||||
_scrollRoutine = StartCoroutine(ScrollLoop(dist));
|
||||
}
|
||||
|
||||
private IEnumerator ScrollLoop(float dist)
|
||||
@@ -52,4 +68,13 @@ public class MarqueeText : MonoBehaviour
|
||||
|
||||
private void SetX(float x) =>
|
||||
_rect.anchoredPosition = new Vector2(x, _rect.anchoredPosition.y);
|
||||
|
||||
private void StopScrolling()
|
||||
{
|
||||
if (_scrollRoutine == null)
|
||||
return;
|
||||
|
||||
StopCoroutine(_scrollRoutine);
|
||||
_scrollRoutine = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user