Commit 7029adbb authored by mmaluschnig's avatar mmaluschnig
Browse files

scene changes to daytime at the end of mime mime

parent 72bf9a12
<Properties StartupConfiguration="{67A4F128-F6AC-CD88-DA35-F29416A0792A}|">
<MonoDevelop.Ide.ItemProperties.Assembly-CSharp PreferredExecutionTarget="Unity.Editor" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/DaytimeScripts/DaytimeManager.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/LevelManager.cs">
<Files>
<File FileName="Assets/TextFiles/TestMultiples.txt" Line="1" Column="1" />
<File FileName="Assets/Scripts/SpawnKeys.cs" Line="98" Column="33" />
<File FileName="Assets/Scripts/Key.cs" Line="17" Column="18" />
<File FileName="Assets/Scripts/TriggerManager.cs" Line="1" Column="1" />
<File FileName="Assets/TextFiles/Bavaria.txt" Line="5" Column="9" />
<File FileName="Assets/Scripts/SimonScripts/SimonScript.cs" Line="58" Column="34" />
<File FileName="Assets/Scripts/SimonScripts/NoteManager.cs" Line="31" Column="10" />
<File FileName="Assets/Scripts/SimonScripts/SimonGameManager.cs" Line="20" Column="57" />
<File FileName="Assets/Scripts/SimonScripts/Note.cs" Line="8" Column="33" />
<File FileName="Assets/Scripts/MenuScripts/PauseMenu.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/DaytimeScripts/DaytimeManager.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/LevelManager.cs" Line="22" Column="9" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
......
......@@ -2,19 +2,30 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class LevelManager : MonoBehaviour {
public Text score;
public Text combo;
private float exitTime;
// Use this for initialization
void Start () {
exitTime = Mathf.Infinity;
}
private void FixedUpdate() {
score.text = "Score: " + (int)MimeMime.PlayerScore;
combo.text = "Combo: " + MimeMime.Combo;
if(Time.time > exitTime){
SceneManager.LoadScene("Daytime");
}
}
public void SongFinished(){
//maybe meke it fade out
exitTime = Time.time + 5;
}
}
......@@ -18,24 +18,16 @@ public class SpawnKeys : MonoBehaviour {
Queue<string[]> songKeys = new Queue<string[]>();
string[] nextKey;
string[] arrows;
float[] timings;
int pointer = 0;
float songWaitTime;
private LevelManager levelManager;
// Use this for initialization
void Start () {
levelManager = GetComponent<LevelManager>();
startTime = Time.time;
//loads data into two side-by-side arrays one holding
//the string value of the arrowkey and the other
//holding the float value of the timestamp that
//the key should be instantiated.
print("Array version");
string[] lines = songFile.text.Split('\n');
arrows = new string[lines.Length-1];
timings = new float[lines.Length-1];
int count = 0;
......@@ -136,6 +128,9 @@ public class SpawnKeys : MonoBehaviour {
}
else
{
if(!endSong){
levelManager.SongFinished();
}
//no more keys
nextKey = null;
endSong = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment