2021-12-24 00:58:48 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
using TMPro;
|
|
|
|
|
|
|
|
|
|
|
|
// hardcoded because im lazy
|
|
|
|
namespace RhythmHeavenMania
|
|
|
|
{
|
|
|
|
public class DebugUI : MonoBehaviour
|
|
|
|
{
|
|
|
|
public GameObject Template;
|
|
|
|
|
|
|
|
private TMP_Text SongPosBeats;
|
|
|
|
private TMP_Text BPM;
|
|
|
|
private TMP_Text currEvent;
|
2021-12-24 08:35:54 +00:00
|
|
|
private TMP_Text eventLength;
|
2021-12-24 00:58:48 +00:00
|
|
|
|
|
|
|
private void Start()
|
|
|
|
{
|
2021-12-24 08:35:54 +00:00
|
|
|
for (int i = 0; i < 4; i++)
|
2021-12-24 00:58:48 +00:00
|
|
|
{
|
|
|
|
GameObject debug = Instantiate(Template, Template.transform.parent);
|
|
|
|
debug.SetActive(true);
|
|
|
|
debug.transform.localPosition = new Vector3(Template.transform.localPosition.x, Template.transform.localPosition.y - 44.9301f * i);
|
|
|
|
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
SongPosBeats = debug.transform.GetChild(0).GetComponent<TMP_Text>();
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
BPM = debug.transform.GetChild(0).GetComponent<TMP_Text>();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
currEvent = debug.transform.GetChild(0).GetComponent<TMP_Text>();
|
|
|
|
break;
|
2021-12-24 08:35:54 +00:00
|
|
|
case 3:
|
|
|
|
eventLength = debug.transform.GetChild(0).GetComponent<TMP_Text>();
|
|
|
|
break;
|
2021-12-24 00:58:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
{
|
|
|
|
SongPosBeats.text = $"SongPosBeats: {Conductor.instance.songPositionInBeats}";
|
|
|
|
BPM.text = $"BPM: {Conductor.instance.songBpm}";
|
2021-12-25 06:22:09 +00:00
|
|
|
if (GameManager.instance.Beatmap.entities.Count > 0)
|
2021-12-24 00:58:48 +00:00
|
|
|
if (GameManager.instance.currentEvent - 1 >= 0)
|
2021-12-24 08:35:54 +00:00
|
|
|
{
|
2021-12-24 00:58:48 +00:00
|
|
|
currEvent.text = $"CurrentEvent: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - 1].datamodel}";
|
2021-12-24 08:35:54 +00:00
|
|
|
eventLength.text = $"Event Length: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - 1].length}";
|
|
|
|
}
|
2021-12-24 00:58:48 +00:00
|
|
|
else
|
2021-12-24 08:35:54 +00:00
|
|
|
{
|
2021-12-24 00:58:48 +00:00
|
|
|
currEvent.text = $"CurrentEvent: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].datamodel}";
|
2021-12-24 08:35:54 +00:00
|
|
|
eventLength.text = $"Event Length: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].length}";
|
|
|
|
}
|
2021-12-24 00:58:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|