Commit 74e1764f authored by astatham's avatar astatham
Browse files

Added QWER/WSAD toggle and Meatball is now a selectable song

parent 642fa14c
fileFormatVersion: 2
guid: 6f6ec19d9670f164ebab9641d068403f
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
......@@ -2,13 +2,27 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class SongSelect : MonoBehaviour {
private SpawnKeys keySpawner;
public Toggle qwerToggle, wsadToggle;
// Use this for initialization
void Start () {
keySpawner = GameObject.FindWithTag("LevelMaster").GetComponent<SpawnKeys>();
Toggle[] toggleArray = gameObject.GetComponentsInChildren<Toggle>();
if (toggleArray[0].tag == "QWER")
{
qwerToggle = toggleArray[0];
wsadToggle = toggleArray[1];
} else
{
qwerToggle = toggleArray[1];
wsadToggle = toggleArray[0];
}
qwerToggle.onValueChanged.AddListener(delegate { ToggleValueChanged(qwerToggle); });
wsadToggle.onValueChanged.AddListener(delegate { ToggleValueChanged(wsadToggle); });
}
public void playSong1(){
......@@ -18,16 +32,28 @@ public class SongSelect : MonoBehaviour {
public void playSong2()
{
keySpawner.Tarantell();
keySpawner.Tarantell();
gameObject.SetActive(false);
}
public void playSong3()
{
keySpawner.Meatball();
gameObject.SetActive(false);
}
public void BackToPerformance(){
SceneManager.LoadScene("NightMenu");
}
}
private void ToggleValueChanged(Toggle toggle)
{
if (toggle.tag == "QWER" && toggle.isOn)
{
GameObject.FindObjectOfType<SpawnKeys>().qwer = true;
} else if (toggle.tag == "WSAD" && toggle.isOn)
{
GameObject.FindObjectOfType<SpawnKeys>().qwer = false;
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SpawnKeys : MonoBehaviour {
......@@ -10,8 +11,13 @@ public class SpawnKeys : MonoBehaviour {
public GameObject W;
public GameObject E;
public GameObject R;
public GameObject up;
public GameObject down;
public GameObject left;
public GameObject right;
public float skip;
public float volumeFade;
public bool qwer = true;
private bool songSet = false;
private string song = "default";
......@@ -30,7 +36,6 @@ public class SpawnKeys : MonoBehaviour {
// Use this for initialization
void Start () {
}
public void startTutorial()
......@@ -122,7 +127,13 @@ public class SpawnKeys : MonoBehaviour {
case "left":
//print("left");
Instantiate(Q, new Vector3(4.85f, 4f, 1f), Quaternion.identity);
if (qwer)
{
Instantiate(Q, new Vector3(4.85f, 4f, 1f), Quaternion.identity);
} else
{
Instantiate(left, new Vector3(4.85f, 4f, 1f), Quaternion.identity);
}
if(ComputerCheck == true){
StartCoroutine(testNote("Left"));
}
......@@ -131,7 +142,13 @@ public class SpawnKeys : MonoBehaviour {
break;
case "right":
//print("right");
Instantiate(R, new Vector3(8.82f, 4f, 1f), Quaternion.identity);
if (qwer)
{
Instantiate(R, new Vector3(8.82f, 4f, 1f), Quaternion.identity);
} else
{
Instantiate(right, new Vector3(8.82f, 4f, 1f), Quaternion.identity);
}
if (ComputerCheck == true)
{
StartCoroutine(testNote("Right"));
......@@ -140,7 +157,13 @@ public class SpawnKeys : MonoBehaviour {
break;
case "up":
//print("up");
Instantiate(W, new Vector3(6.18f, 4f, 1f), Quaternion.identity);
if (qwer)
{
Instantiate(W, new Vector3(6.18f, 4f, 1f), Quaternion.identity);
} else
{
Instantiate(up, new Vector3(6.18f, 4f, 1f), Quaternion.identity);
}
if (ComputerCheck == true)
{
StartCoroutine(testNote("Up"));
......@@ -149,7 +172,13 @@ public class SpawnKeys : MonoBehaviour {
break;
case "down":
//print("DOWN");
Instantiate(E, new Vector3(7.51f, 4f, 1f), Quaternion.identity);
if (qwer)
{
Instantiate(E, new Vector3(7.51f, 4f, 1f), Quaternion.identity);
} else
{
Instantiate(down, new Vector3(7.51f, 4f, 1f), Quaternion.identity);
}
if (ComputerCheck == true)
{
StartCoroutine(testNote("Down"));
......@@ -187,6 +216,12 @@ public class SpawnKeys : MonoBehaviour {
songSet = true;
}
public void Meatball()
{
songFile = Resources.Load<TextAsset>("Meatball");
songSet = true;
}
public void setVolume(float volume)
{
music.volume = volume;
......
......@@ -30,6 +30,8 @@ TagManager:
- BottomRight
- BottomCentre
- playerInput
- QWER
- WSAD
layers:
- Default
- TransparentFX
......
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