vdfs n idk what else
This commit is contained in:
1 parent
51a9dccd97
commit
3c211a56fb
15 files changed
+130
-11
No files matched your search
@@ -14,6 +14,7 @@ public class TimingUI : MonoBehaviour {
|
||||
|
||||
VisualElement timer;
|
||||
VisualElement timerSectors;
|
||||
Label timerMsg;
|
||||
Label timerTime;
|
||||
Label timerPb;
|
||||
Label timerPosition;
|
||||
@@ -62,6 +63,7 @@ public class TimingUI : MonoBehaviour {
|
||||
noticeTime = uiDocument.rootVisualElement.Q<Label>("noticeTime");
|
||||
noticeDiff = uiDocument.rootVisualElement.Q<VisualElement>("noticeDiff");
|
||||
|
||||
timerMsg = uiDocument.rootVisualElement.Q<Label>("msg");
|
||||
timerTime = uiDocument.rootVisualElement.Q<Label>("timerTime");
|
||||
timerPb = uiDocument.rootVisualElement.Q<Label>("timerPb");
|
||||
|
||||
@@ -124,12 +126,17 @@ public class TimingUI : MonoBehaviour {
|
||||
timer.AddToClassList("hidden");
|
||||
notice.RemoveFromClassList("hidden");
|
||||
|
||||
TimingNotice lapNotice = timing.CompareLap(lap);
|
||||
|
||||
noticeTime.text = lap.ToString();
|
||||
noticeDiff.Clear();
|
||||
noticeDiff.Add(timing.CompareLap(lap).ToLabel());
|
||||
noticeDiff.Add(lapNotice.ToLabel());
|
||||
|
||||
// int msgIndex = UnityEngine.Random.Range(0, completionMsgs.Length);
|
||||
// noticeMsg.text = completionMsgs[msgIndex];
|
||||
if (lapNotice.Category == NoticeCategory.Faster) ShowMessage("New PB!");
|
||||
if (lapNotice.Category == NoticeCategory.Fastest) {
|
||||
int msgIndex = UnityEngine.Random.Range(0, completionMsgs.Length);
|
||||
ShowMessage(completionMsgs[msgIndex]);
|
||||
}
|
||||
|
||||
noticeSectors.Clear();
|
||||
foreach (SectorTime sector in lap.Sectors) {
|
||||
@@ -140,7 +147,16 @@ public class TimingUI : MonoBehaviour {
|
||||
|
||||
public void HideRecentLap() {
|
||||
Init();
|
||||
HideMessage();
|
||||
timer.RemoveFromClassList("hidden");
|
||||
notice.AddToClassList("hidden");
|
||||
}
|
||||
|
||||
public void ShowMessage(string msg) {
|
||||
timerMsg.text = msg;
|
||||
}
|
||||
|
||||
public void HideMessage() {
|
||||
timerMsg.text = "";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user