// Update is called once per frame
    void Update()
    {
        if (yellowButton.isActivated() && redButton.isActivated() && blueButton.isActivated())
        {
            Debug.Log("All good");
            exitDoor.SetActive(false);
        }

        //options to reset block positions
        if (Input.GetKey(KeyCode.R))
        {
            redBlock.Reset();
        }
        if (Input.GetKey(KeyCode.F))
        {
            yellowBlock.Reset();
        }
        if (Input.GetKey(KeyCode.V))
        {
            blueBlock.Reset();
        }


        if (Input.GetKey(KeyCode.Escape))
        {
            Application.Quit();
        }
    }
Example #2
0
    private void Update()
    {
        //disable wall if corresponding button is active
        if (yellowButton.isActivated() && gameObject.name == "YellowWall")
        {
            gameObject.SetActive(false);
        }

        else if (redButton.isActivated() && gameObject.name == "RedWall")
        {
            gameObject.SetActive(false);
        }

        else if (blueButton.isActivated() && gameObject.name == "BlueWall")
        {
            gameObject.SetActive(false);
        }

        else
        {
            gameObject.SetActive(true);
        }
    }