feat: polish game HUD scoring and results
This commit is contained in:
@@ -14,9 +14,10 @@ public class SongController : MonoBehaviour
|
||||
[SerializeField] private TMP_Text countdownText;
|
||||
|
||||
private const float LaneSpacing = 0.42f;
|
||||
private const float LayerSpacing = 0.38f;
|
||||
private const float LayerSpacing = 0.34f;
|
||||
private const float HorizontalCenter = 1.5f;
|
||||
private const float VerticalCenter = 1f;
|
||||
private const float VerticalOffset = 0.22f;
|
||||
|
||||
private AudioManager _audio;
|
||||
private ScoreManager _scoreManager;
|
||||
@@ -84,6 +85,11 @@ public class SongController : MonoBehaviour
|
||||
yield break;
|
||||
}
|
||||
map.target.Sort(CompareNotes);
|
||||
if (_clipLength <= 0.0f)
|
||||
{
|
||||
float lastNoteTime = map.target.Count > 0 ? map.target[map.target.Count - 1].time : 0.0f;
|
||||
_clipLength = Mathf.Max(song.duration, lastNoteTime + 1.0f);
|
||||
}
|
||||
_scoreManager?.SetTotalNotes(map.target.Count);
|
||||
|
||||
yield return StartCoroutine(Countdown());
|
||||
@@ -91,7 +97,7 @@ public class SongController : MonoBehaviour
|
||||
_audio.PlayClip(clip);
|
||||
|
||||
StartCoroutine(SpawnRoutine(map.target));
|
||||
yield return StartCoroutine(WaitForCompletion(clip.length, map.target));
|
||||
yield return StartCoroutine(WaitForCompletion(_clipLength, map.target));
|
||||
}
|
||||
|
||||
private IEnumerator Countdown()
|
||||
@@ -168,7 +174,7 @@ public class SongController : MonoBehaviour
|
||||
private static float MapLayerY(int lineLayer)
|
||||
{
|
||||
int layer = Mathf.Clamp(lineLayer, 0, 2);
|
||||
return (layer - VerticalCenter) * LayerSpacing;
|
||||
return VerticalOffset + (layer - VerticalCenter) * LayerSpacing;
|
||||
}
|
||||
|
||||
// Beat Saber cutDirection → VRBeats Direction
|
||||
|
||||
Reference in New Issue
Block a user