Exemplo n.º 1
0
    public void flipTheSwitch()
    {
        if (switchEnabled && gotKey)
        {
            if (switchOff)
            {
                theSwitch.turnOn();
                StartCoroutine(theDoor.OpenCoroutine());
                switchOff = false;
            }

            else if (!switchOff)
            {
                theSwitch.turnOff();
                StartCoroutine(theDoor.CloseCoroutine());
                switchOff = true;
            }
        }
    }