private bool CheckDoorExists(GameObject room, Door.Location doorLocation) { foreach (Transform child in room.transform) { if (child.tag == "Door") { Door door = child.GetComponent <Door>(); if (door.DoorLocation == doorLocation) { return(true); } } } return(false); }
private Vector3 RoomEnterPositionDemoTwo(GameObject room, Door.Location doorLocation) { foreach (Transform child in room.transform) { if (child.tag == "Door") { Door door = child.GetComponent <Door>(); if (door.DoorLocation == doorLocation) { return(child.position); } } } return(room.transform.position); }
private Door.Location OppositeLocation(Door.Location location) { if (location == Door.Location.North) { return(Door.Location.South); } else if (location == Door.Location.West) { return(Door.Location.East); } else if (location == Door.Location.South) { return(Door.Location.North); } else //(location == Door.Location.East) { return(Door.Location.West); } }