using UnityEngine;
using System.Collections;

public class CheckJoysticksController : MonoBehaviour {

    public GameObject Controller1 = null;
    public GameObject Controller2 = null;
    public GameObject Controller3 = null;
    public GameObject Controller4 = null;

    private bool controller1Visible = false;
    private bool controller2Visible = false;
    private bool controller3Visible = false;
    private bool controller4Visible = false;
	
	void Update () 
    {
        controller1Visible = (Input.GetButton("P1_Jump")) ? true : false;
        controller2Visible = (Input.GetButton("P2_Jump")) ? true : false;
        controller3Visible = (Input.GetButton("P3_Jump")) ? true : false;
        controller4Visible = (Input.GetButton("P4_Jump")) ? true : false;

        if (Controller1 != null)
        {
            Controller1.SetActive(controller1Visible);
        }

        if (Controller2 != null)
        {
            Controller2.SetActive(controller2Visible);
        }

        if (Controller3 != null)
        {
            Controller3.SetActive(controller3Visible);
        }

        if (Controller4 != null)
        {
            Controller4.SetActive(controller4Visible);
        }
	}
}
