|
|
@ -9,6 +9,7 @@ public class menuContrller : MonoBehaviour { |
|
|
|
public GameObject levelSelect; |
|
|
|
public GameObject instructions; |
|
|
|
public GameObject xboxLayout; |
|
|
|
public GameObject btn_1player; |
|
|
|
public GameObject btn_2player; |
|
|
|
public GameObject btn_3player; |
|
|
|
public GameObject btn_4player; |
|
|
@ -19,14 +20,46 @@ public class menuContrller : MonoBehaviour { |
|
|
|
public GameObject platypuss; |
|
|
|
public GameObject goat; |
|
|
|
public GameObject kangaroo; |
|
|
|
private bool p1Enabled = false; |
|
|
|
private bool p2Enabled = false; |
|
|
|
private bool p3Enabled = false; |
|
|
|
private bool p4Enabled = false; |
|
|
|
|
|
|
|
// Use this for initialization
|
|
|
|
void Start () { |
|
|
|
|
|
|
|
control = GameObject.FindGameObjectWithTag ("GameController").GetComponent<levelController> (); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update () { |
|
|
|
|
|
|
|
if (Input.GetAxisRaw ("Vertical_P1") == 1) { |
|
|
|
Debug.Log("button hit"); |
|
|
|
p1Enabled = true; |
|
|
|
btn_1player.GetComponent<Image> ().color = Color.green; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Input.GetAxisRaw ("Vertical_P2") == 1) { |
|
|
|
p2Enabled = true; |
|
|
|
btn_2player.GetComponent<Image> ().color = Color.green; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Input.GetAxisRaw ("Vertical_P3") == 1) { |
|
|
|
p3Enabled = true; |
|
|
|
btn_3player.GetComponent<Image> ().color = Color.green; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Input.GetAxisRaw ("Vertical_P4") == 1) { |
|
|
|
p4Enabled = true; |
|
|
|
btn_4player.GetComponent<Image> ().color = Color.green; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void panelSelect (string panel){ |
|
|
@ -68,24 +101,35 @@ public class menuContrller : MonoBehaviour { |
|
|
|
} |
|
|
|
|
|
|
|
public void playerSelect (int players){ |
|
|
|
btn_2player.GetComponent<Image> ().color = Color.grey; |
|
|
|
btn_3player.GetComponent<Image> ().color = Color.grey; |
|
|
|
btn_4player.GetComponent<Image> ().color = Color.grey; |
|
|
|
|
|
|
|
control.playerCount = players; |
|
|
|
|
|
|
|
if (players == 2) |
|
|
|
btn_2player.GetComponent<Image> ().color = Color.red; |
|
|
|
if (players == 3) |
|
|
|
btn_3player.GetComponent<Image> ().color = Color.red; |
|
|
|
if (players == 4) |
|
|
|
btn_4player.GetComponent<Image> ().color = Color.red; |
|
|
|
if (players == 1) { |
|
|
|
btn_1player.GetComponent<Image> ().color = Color.green; |
|
|
|
p1Enabled = true; |
|
|
|
} |
|
|
|
if (players == 2) { |
|
|
|
btn_2player.GetComponent<Image> ().color = Color.green; |
|
|
|
p2Enabled = true; |
|
|
|
} |
|
|
|
if (players == 3) { |
|
|
|
btn_3player.GetComponent<Image> ().color = Color.green; |
|
|
|
p3Enabled = true; |
|
|
|
} |
|
|
|
if (players == 4) { |
|
|
|
btn_4player.GetComponent<Image> ().color = Color.green; |
|
|
|
p4Enabled = true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void levelStart (string level){ |
|
|
|
|
|
|
|
control.p1Enabled = p1Enabled; |
|
|
|
control.p2Enabled = p2Enabled; |
|
|
|
control.p3Enabled = p3Enabled; |
|
|
|
control.p4Enabled = p4Enabled; |
|
|
|
|
|
|
|
Application.LoadLevel (level); |
|
|
|
|
|
|
|
} |
|
|
|