コード例 #1
0
    public override void Generate(GridMaintaner gridMaintaner)
    {
        if (_pointOfInterestPrefabs.Count == 0)
        {
            GrabPOIPrefabs();
        }

        #region TEMP
        List <Vector2Int> points = gridMaintaner.GetComponent <TEMP_SpecificPointsOfInterest>().Points;
        foreach (Vector2Int point in points)
        {
            PointOfInterest   poi     = _pointOfInterestPrefabs[PointsOfInterest.POIType.DEAD_END];
            List <Vector2Int> offsets = poi.GetPointOffsets();
            foreach (Vector2Int offset in offsets)
            {
                TileAttributes attr = gridMaintaner.GetTileAt(point + offset);
                attr.SetOpenDirections(poi.GetOpenDirectionsOfTile(offset));
                attr.SetTileType(Attributes.TileType.POINT_OF_INTEREST);
            }
            TileAttributes ti = gridMaintaner.GetTileAt(point);
            ti.SetTileType(Attributes.TileType.POINT_OF_INTEREST_MAIN);
        }
        #endregion

        LogSuccess("points of interest");
    }
コード例 #2
0
    public override void Generate(GridMaintaner gridMaintaner)
    {
        TileAttributes tile = gridMaintaner.GetTileAt(Vector2Int.zero);

        tile.SetTileType(Attributes.TileType.STARTING_TILE);
        tile.SetOpenDirections(Attributes.OpenDirections.ALL);

        LogSuccess("first tile");
    }