public override void Init(LevelSettings levelSettings)
    {
        base.Init(levelSettings);
        tilesGroup.Init(levelXRange, levelYRange);
        int tilesCount = levelSettings.GetTilesCount(this);

        if (tilesCount != 0)
        {
            tilesGroup.ApplyDirectionToCount(tilesCount);
        }
    }
Exemple #2
0
    public override void Init(LevelSettings levelSettings)
    {
        tilesGroups.Clear();
        base.Init(levelSettings);
        int tilesCount = levelSettings.GetTilesCount(this);

        instancesCount = tilesCount == 0 ? defaultInstanceCount : tilesCount;

        for (int i = 0; i < instancesCount; i++)
        {
            int        randomX    = (int)Mathf.Round(levelXRange.Interval * xArea.Random);
            int        randomY    = (int)Mathf.Round(levelYRange.Interval * yArea.Random);
            TilesGroup tilesGroup = new TilesGroup(TilesGroup.Orientation.LowerLeft, new Vector2Int(randomX, randomY), instanceDirection, isInstanceRect);
            tilesGroup.Init(levelXRange, levelYRange);
            tilesGroups.Add(tilesGroup);
        }
    }