Пример #1
0
    public Building(BuildingSdo sdo)
    {
        if (sdo == null)
        {
            return;
        }

        Height = sdo.Height;
        Width  = sdo.Width;

        FloorTiles     = new GameObject[Height, Width];
        WallTiles      = new GameObject[Height, Width];
        WallTypeIndex  = sdo.WallTypeIndex;
        FloorTypeIndex = sdo.FloorTypeIndex;

        _wallTilePrefabs  = BuildingPrefabStore.GetWallTileTypeAt(WallTypeIndex);
        _floorTilePrefabs = BuildingPrefabStore.GetFloorTileTypeAt(FloorTypeIndex);

        Blueprint = BuildingSdo.ConvertBlueprintForLoading(Height, Width, sdo.Blueprint);

        Props = BuildingSdo.ConvertPropsForPlaying(Height, Width, sdo.PropSdos);

        AddedDoorLocations = BuildingSdo.ConvertBlueprintForLoading(Height, Width, sdo.AddedDoorLocations);

        //todo need room sdo -- maybe

        Build();
    }
Пример #2
0
    private void PickTilePrefabs()
    {
        WallTypeIndex    = BuildingPrefabStore.GetRandomWallTypeIndex();
        _wallTilePrefabs = BuildingPrefabStore.GetWallTileTypeAt(WallTypeIndex);

        FloorTypeIndex    = BuildingPrefabStore.GetRandomFloorTypeIndex();
        _floorTilePrefabs = BuildingPrefabStore.GetFloorTileTypeAt(FloorTypeIndex);
    }