Prep for main gameplay

This commit is contained in:
Thastertyn committed 2024-06-13 14:46:43 +02:00
1 parent 079c01b01c
commit e56da61974
3 files changed
+44

No files matched your search

+19
View File
@@ -7,6 +7,7 @@ using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UIElements;
using BangerTypes;
namespace UITypes
{
@@ -30,6 +31,11 @@ namespace UITypes
private VisualElement upUpcomingColumn;
public VisualElement downUpcomingColumn;
private bool leftActive = false;
private bool rightActive = false;
private bool downActive = false;
private bool upActive = false;
private Label score;
private Label songTime;
@@ -97,6 +103,19 @@ namespace UITypes
songTime.text = time;
}
public void UpdateNotes(Note[] notes)
{
leftActive = notes.Where(note => note.a == "left").Count() > 0;
rightActive = notes.Where(note => note.a == "right").Count() > 0;
upActive = notes.Where(note => note.a == "up").Count() > 0;
downActive = notes.Where(note => note.a == "down").Count() > 0;
leftUpcomingColumn.EnableInClassList("ColumnActive", leftActive);
rightUpcomingColumn.EnableInClassList("ColumnActive", rightActive);
downUpcomingColumn.EnableInClassList("ColumnActive", downActive);
upUpcomingColumn.EnableInClassList("ColumnActive", upActive);
}
void OnKeyDown(KeyDownEvent ev)
{
if (ev.keyCode == KeyCode.Escape)