diff --git a/playable/Assets/Prefabs/Options.prefab b/playable/Assets/Prefabs/Options.prefab new file mode 100644 index 0000000..569362c Binary files /dev/null and b/playable/Assets/Prefabs/Options.prefab differ diff --git a/playable/Assets/Prefabs/Options.prefab.meta b/playable/Assets/Prefabs/Options.prefab.meta new file mode 100644 index 0000000..05a971f --- /dev/null +++ b/playable/Assets/Prefabs/Options.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 7d6b76bf421752e48a6967c631cb08db +NativeFormatImporter: + userData: diff --git a/playable/Assets/Scenes/Level1.unity b/playable/Assets/Scenes/Level1.unity index ca928a4..2d0a0b2 100644 Binary files a/playable/Assets/Scenes/Level1.unity and b/playable/Assets/Scenes/Level1.unity differ diff --git a/playable/Assets/Scenes/Level2.unity b/playable/Assets/Scenes/Level2.unity index e146da9..ade8110 100644 Binary files a/playable/Assets/Scenes/Level2.unity and b/playable/Assets/Scenes/Level2.unity differ diff --git a/playable/Assets/Scripts/playerId.cs b/playable/Assets/Scripts/playerId.cs index 5b8e1ee..3c3f3f5 100644 --- a/playable/Assets/Scripts/playerId.cs +++ b/playable/Assets/Scripts/playerId.cs @@ -2,9 +2,11 @@ using System.Collections; public class playerId : MonoBehaviour { - public bool idVanish = true; + public bool idVanish = false; public GameObject idTag; + public bool idVanishDisp = true; + // Use this for initialization void Start () { @@ -16,8 +18,9 @@ public class playerId : MonoBehaviour { transform.eulerAngles = new Vector3 (transform.eulerAngles.x, 180, transform.eulerAngles.z); - if (Input.GetKeyDown (KeyCode.Backspace)) { + if (Input.GetKeyDown (KeyCode.Backspace) || idVanish != idVanishDisp) { idVanish = !idVanish; + idVanishDisp = idVanish; idTag.gameObject.SetActive (idVanish); diff --git a/playable/Assets/sceneController.cs b/playable/Assets/sceneController.cs index 450f3ac..90ef430 100644 --- a/playable/Assets/sceneController.cs +++ b/playable/Assets/sceneController.cs @@ -1,5 +1,6 @@ using UnityEngine; using System.Collections; +using UnityEngine.UI; public class sceneController : MonoBehaviour { @@ -9,11 +10,23 @@ public class sceneController : MonoBehaviour { public GameObject player4; public levelController control; private int playerCount; + public GameObject options; + public bool paused = false; + public GameObject confettiText; + public GameObject scoreText; + + public playerId id1; + public playerId id2; + public playerId id3; + public playerId id4; private playerController playerScript1; private playerController playerScript2; private playerController playerScript3; private playerController playerScript4; + + private bool exit = false; + // Use this for initialization void Awake(){ @@ -59,6 +72,84 @@ public class sceneController : MonoBehaviour { // Update is called once per frame void Update () { + + if (Input.GetButtonDown("start")) { + paused = !paused; + + } + + optionsSelect (); + + + } + + public void optionsSelect(){ + + if (paused) { + Time.timeScale = 0.0f; + options.SetActive (true); + + + + } else if (!paused) { + Time.timeScale = 1.0f; + options.SetActive (false); + } + + if (exit) { + Time.timeScale = 1.0f; + Application.LoadLevel("Menu_Scene"); + + + } + + + + } + + public void confetti(float confettiAmount){ + control.confetti = Mathf.RoundToInt(confettiAmount); + confettiText.GetComponent ().text = "" + Mathf.RoundToInt(confettiAmount); + playerScript1.confettiOnHit = control.confetti; + playerScript2.confettiOnHit = control.confetti; + playerScript3.confettiOnHit = control.confetti; + playerScript4.confettiOnHit = control.confetti; + } + + public void sccore (float scoreMax){ + control.maxScore = Mathf.RoundToInt(scoreMax); + scoreText.GetComponent ().text = "" + Mathf.RoundToInt(scoreMax); + playerScript1.maxScore = control.maxScore; + playerScript2.maxScore = control.maxScore; + playerScript3.maxScore = control.maxScore; + playerScript4.maxScore = control.maxScore; + } + + public void mute (bool muted){ + if (muted) + AudioListener.volume = 0.0f; + else + AudioListener.volume = 1.0f; + } + + public void dispID (bool visible){ + id1.idVanishDisp = visible; + id2.idVanishDisp = visible; + id3.idVanishDisp = visible; + id4.idVanishDisp = visible; + + } + + public void exitLevel (){ + Time.timeScale = 1.0f; + exit = true; + } + + public void resumeGame(){ + paused = false; + } + + } diff --git a/playable/ProjectSettings/InputManager.asset b/playable/ProjectSettings/InputManager.asset index 633b3db..7bcc514 100644 Binary files a/playable/ProjectSettings/InputManager.asset and b/playable/ProjectSettings/InputManager.asset differ