public Direction[] NewRoom(GameObject room) { GameObject newRoom = Instantiate(room, transform.position, Quaternion.identity) as GameObject; PickRoomType(); PickDirections(); while (!CheckDirections()) { PickRoomType(); PickDirections(); } Room newRoomInfo = newRoom.GetComponent<Room>(); newRoomInfo.SetData(directions); //this calls Room script roomData = new RoomData(true, roomType, directions); return directions; //returns to RoomGenerator }
void Awake() { roomData = new RoomData(false); roomTargetsList = new List<GameObject>(); }