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; } } }