// Update is called once per frame
    void Update()
    {
        // switchMenu.SetActive(true);
        if (!gameController)
        {
            gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameControllerScript>();
        }

        if ((Input.GetButton("Character1") || Input.GetButton("Character2") || Input.GetButton("Character3")) && !pauseMenu.GameIsPaused)
        {
            Debug.Log(gameController.GetCurrentPlayerIndex());

            if (Input.GetButtonDown("Character1") && gameController.GetCurrentPlayerIndex() != 1)
            {
                ChangeArrowKeyColor(1);
                player.GetComponent <PlayerPlatformerController>().switchChar(0);

                effect_animator.SetTrigger("change_trigger");

                gameController.SetCurrentPlayerIndex(1);
            }
            else if (Input.GetButtonDown("Character2") && gameController.IsCharacterUnlocked(1) && gameController.GetCurrentPlayerIndex() != 2)
            {
                Debug.Log(gameController.GetCurrentPlayerIndex());
                ChangeArrowKeyColor(2);
                player.GetComponent <PlayerPlatformerController>().switchChar(1);

                effect_animator.SetTrigger("change_trigger");

                gameController.SetCurrentPlayerIndex(2);
            }
            else if (Input.GetButtonDown("Character3") && gameController.IsCharacterUnlocked(2) && gameController.GetCurrentPlayerIndex() != 3)
            {
                Debug.Log(gameController.GetCurrentPlayerIndex());

                ChangeArrowKeyColor(3);
                player.GetComponent <PlayerPlatformerController>().switchChar(2);

                effect_animator.SetTrigger("change_trigger");

                gameController.SetCurrentPlayerIndex(3);
            }
            Time.timeScale = 1f;
        }
    }
    // Use this for initialization
    void Start()
    {
        gameControllerScript = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameControllerScript>();
        Debug.Log(gameControllerScript.IsCharacterUnlocked(1));
        Debug.Log(gameControllerScript.IsCharacterUnlocked(2));
        Debug.Log(gameControllerScript.IsCharacterUnlocked(3));

        if (gameControllerScript.IsCharacterUnlocked(1))
        {
            dash_image.GetComponent <Image>().color = Color.white;
        }
        else
        {
            dash_image.GetComponent <Image>().color = Color.black;
        }
        if (gameControllerScript.IsCharacterUnlocked(2))
        {
            gravity_image.GetComponent <Image>().color = Color.white;
        }
        else
        {
            gravity_image.GetComponent <Image>().color = Color.black;
        }
        if (gameControllerScript.IsCharacterUnlocked(3))
        {
            fourth_image.GetComponent <Image>().color = Color.white;
        }
        else
        {
            fourth_image.GetComponent <Image>().color = Color.black;
        }
    }