示例#1
0
    private RoomInstance CreateRoom(PlacedRoomInfo roomInfo)
    {
        RoomInstance instance = RoomInstance.PlaceRoom(m_RoomPrefab, roomInfo.m_IsBossRoom, m_FloorSettings, roomInfo.m_Settings, roomInfo.m_Centre, roomInfo.m_Extents, roomInfo.m_Connection);

        instance.transform.parent = transform;
        return(instance);
    }
示例#2
0
    private PlacedRoomInfo NewRoomInfo(List <PlacedRoomInfo> roomInfos, int totalCount)
    {
        RoomSettings settings;

        if (roomInfos.Count == 0)
        {
            settings = m_FloorSettings.m_SpawnRoom;
            Vector3Int centre  = new Vector3Int();
            Vector3Int extents = settings.RandomExtents();
            return(new PlacedRoomInfo(settings, centre, extents));
        }
        else if (roomInfos.Count == totalCount - 1)
        {
            settings = m_FloorSettings.m_BossRoom;

            PlacedRoomInfo roomInfo = PlacedRoomInfo.FindRoomSlot(settings, roomInfos);
            roomInfo.m_IsBossRoom = true;
            return(roomInfo);
        }
        else
        {
            settings = m_FloorSettings.SelectRandomRoom();
        }

        return(PlacedRoomInfo.FindRoomSlot(settings, roomInfos));
    }