private void OnTriggerEnter2D(Collider2D collision) { // if door(s) are open if (fromRoom.getStatus() == 2 && collision.name == "Casper") { switch (name) { case "Top_Door": if (!fromRoom.isOpen(name)) { break; } bufferSwitch("BOTTOM", "UP"); break; case "Bottom_Door": if (!fromRoom.isOpen(name)) { break; } bufferSwitch("TOP", "DOWN"); break; case "Right_Door": if (!fromRoom.isOpen(name)) { break; } bufferSwitch("LEFT", "RIGHT"); break; case "Left_Door": if (!fromRoom.isOpen(name)) { break; } bufferSwitch("RIGHT", "LEFT"); break; case "Right_1": case "Right_2": bufferSwitch("LEFT", "RIGHT"); break; case "Left_1": case "Left_2": bufferSwitch("RIGHT", "LEFT"); break; } //Debug.Log("Status is OPEN, " + fromRoom.name + " " + name); //Debug.Log("Going to room: " + nextRoom.name); } }