Example #1
0
    void OnTriggerStay(Collider other)
    {
        if (other.gameObject.name == "FPSController")
        {
            if (Input.GetKey(KeyCode.Return) && !cam2.enabled)
            {
                cam1.enabled = false;
                cam1.gameObject.GetComponent <AudioListener>().enabled = false;
                cam2.gameObject.GetComponent <AudioListener>().enabled = true;
                cam2.enabled  = true;
                board.enabled = false;
                game.GetMenu();
                GameObject.FindGameObjectWithTag("Player").GetComponent <FirstPersonController>().enabled = false;
            }

            /*if (Input.GetKey(KeyCode.Escape))
             * {
             *  GameObject.FindGameObjectWithTag("Player").GetComponent<FirstPersonController>().enabled = true;
             *  cam1.gameObject.GetComponent<AudioListener>().enabled = true;
             *  cam2.gameObject.GetComponent<AudioListener>().enabled = false;
             *  board.enabled = true;
             *  cam2.enabled = false;
             *  cam1.enabled = true;
             *  game = null;
             *
             * }*/
        }
    }