Commit c46793b0 authored by gstuitje's avatar gstuitje
Browse files
parents 8df43209 16f87cbf
fileFormatVersion: 2
guid: b4a392ef8715749d8b2969e99d69b947
guid: 9d2e27556df364a7da1e1c9fa7e00598
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
Tarantella 8.0
left 1.5
right 2.35
down 2.5
up 2.7
up 5
down 5.45
up 5.8
left 6.1
right 6.6
down 7.45
up 8.7
up 9.9
down 10.35
left 10.58
right 10.84
up 11.05
down 11.38
up 11.7
left 12.3
right 12.6
down 13.5
up 14.58
left 15.0
right 15.25
up 15.4
left 15.6
up 15.8
down 16
left 16.25
right 16.5
left 16.75
left 17.6
right 17.9
down 18.8
up 19
up 19.55
down 19.85
left 20.4
right 20.7
up 22.25
\ No newline at end of file
......@@ -7112,6 +7112,10 @@ Prefab:
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1602431506710890, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
m_IsPrefabAsset: 0
......
......@@ -315,10 +315,10 @@ RectTransform:
m_Father: {fileID: 1407271059}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -326, y: -122}
m_SizeDelta: {x: 100, y: 100}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 73, y: 102.5}
m_SizeDelta: {x: 100, y: 101}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &198828738
GameObject:
......@@ -3580,8 +3580,8 @@ RectTransform:
m_Father: {fileID: 1407271059}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -372, y: 104}
m_SizeDelta: {x: 100, y: 100}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 27, y: -120.5}
m_SizeDelta: {x: 100, y: 101}
m_Pivot: {x: 0.5, y: 0.5}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SongSelect : MonoBehaviour {
private SpawnKeys keySpawner;
// Use this for initialization
void Start () {
keySpawner = GameObject.FindWithTag("LevelMaster").GetComponent<SpawnKeys>();
}
public void playSong1(){
keySpawner.Bavaria();
gameObject.SetActive(false);
}
public void playSong2()
{
keySpawner.Tarantell();
gameObject.SetActive(false);
}
public void playSong3()
{
}
public void BackToPerformance(){
SceneManager.LoadScene("NightMenu");
}
}
fileFormatVersion: 2
guid: 038a612a63b4e416e8ea04c2d651ab75
folderAsset: yes
DefaultImporter:
guid: 1666ed9dc339e47e99646f5ec0ccd426
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -10,6 +10,7 @@ public class SpawnKeys : MonoBehaviour {
public float skip;
public float volumeFade;
private bool songSet = false;
private string song = "default";
private float startTime;
private bool endSong = false;
......@@ -26,37 +27,7 @@ public class SpawnKeys : MonoBehaviour {
// Use this for initialization
void Start () {
levelManager = GetComponent<LevelManager>();
startTime = Time.time;
int count = 0;
//Same as above but uses queues, will have to parse
//string of timings into a float later on.
print("Queue version!");
foreach (string line in songFile.text.Split('\n'))
{
if (count != 0)
{
songKeys.Enqueue(line.Split(' '));
}else{
song = line.Split(' ')[0];
songWaitTime = float.Parse(line.Split(' ')[1]);
}
count++;
}
nextKey = songKeys.Dequeue();
//print out queue
//while (songKeys.Count > 0)
//{
// string[] x = songKeys.Dequeue();
// print(x[0] + " " + x[1]);
//}
AudioClip songAudio = Resources.Load<AudioClip>(song);
songWaitTime = songWaitTime / arrowPrefab.GetComponent<Key>().speed;
StartCoroutine(playSong(songAudio, songWaitTime));
}
......@@ -84,6 +55,43 @@ public class SpawnKeys : MonoBehaviour {
}
void Update () {
if(songSet == true){
levelManager = GetComponent<LevelManager>();
startTime = Time.time;
int count = 0;
//Same as above but uses queues, will have to parse
//string of timings into a float later on.
print("Queue version!");
foreach (string line in songFile.text.Split('\n'))
{
if (count != 0)
{
songKeys.Enqueue(line.Split(' '));
}
else
{
song = line.Split(' ')[0];
print("Song: " + song);
songWaitTime = float.Parse(line.Split(' ')[1]);
}
count++;
}
nextKey = songKeys.Dequeue();
//print out queue
//while (songKeys.Count > 0)
//{
// string[] x = songKeys.Dequeue();
// print(x[0] + " " + x[1]);
//}
AudioClip songAudio = Resources.Load<AudioClip>(song);
songWaitTime = songWaitTime / arrowPrefab.GetComponent<Key>().speed;
StartCoroutine(playSong(songAudio, songWaitTime));
songSet = false;
}
if(endSong == true){
music.volume -= (volumeFade * Time.deltaTime);
}
......@@ -149,4 +157,15 @@ public class SpawnKeys : MonoBehaviour {
}
}
}
public void Bavaria(){
songFile = Resources.Load<TextAsset>("Bavaria");
print(songFile);
songSet = true;
}
public void Tarantell(){
songFile = Resources.Load<TextAsset>("Tarantella");
songSet = true;
}
}
fileFormatVersion: 2
guid: 949cab2b835c04abe91819c4edc81c96
guid: 0bb8a9baae64949078b0d70a928a5848
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
fileFormatVersion: 2
guid: f2518afe8017047b895d461dd5be860e
guid: 289d382b3061449ed9d1c4925bcd7231
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
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