Prep for main gameplay
This commit is contained in:
1 parent
079c01b01c
commit
e56da61974
3 files changed
+44
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user