Prep for main gameplay
This commit is contained in:
1 parent
079c01b01c
commit
e56da61974
3 files changed
+44
No files matched your search
@@ -4,8 +4,10 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.UIElements;
|
||||
using System.Linq;
|
||||
|
||||
using UITypes;
|
||||
using BangerTypes;
|
||||
|
||||
public class Game : MonoBehaviour
|
||||
{
|
||||
@@ -19,6 +21,9 @@ public class Game : MonoBehaviour
|
||||
string totalDuration;
|
||||
bool repeatRoutine = true;
|
||||
|
||||
Song song = null;
|
||||
|
||||
Note[] activeNotes;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -35,6 +40,21 @@ public class Game : MonoBehaviour
|
||||
menu.GameElem.UpdateVisualizers(specData, bassStrength);
|
||||
|
||||
UpdateTimestamp();
|
||||
GetNotes();
|
||||
}
|
||||
|
||||
public void GetNotes()
|
||||
{
|
||||
float timestamp = manager.source.time;
|
||||
|
||||
activeNotes = song.Notes.Where(note => note.t >= timestamp && timestamp + 1f <= note.t).ToArray();
|
||||
|
||||
if(activeNotes.Length > 0)
|
||||
{
|
||||
Debug.Log("Found some notes");
|
||||
}
|
||||
|
||||
menu.GameElem.UpdateNotes(activeNotes);
|
||||
}
|
||||
|
||||
IEnumerator GameLoop()
|
||||
@@ -48,6 +68,7 @@ public class Game : MonoBehaviour
|
||||
|
||||
public void LoadSong(SongEntry song)
|
||||
{
|
||||
this.song = song.Song;
|
||||
totalDuration = song.Song.Duration;
|
||||
|
||||
manager.source.clip = song.Song.Clip;
|
||||
|
||||
Reference in new issue
Block a user