Пример #1
0
        private void Fill()
        {
            var size = _config.Unique.Get <MapSizeComponent>().Component.Value;

            for (int row = 0; row < size.y; row++)
            {
                for (int column = 0; column < size.x; column++)
                {
                    float random = (float)Random.Value.NextDouble();
                    //float random = Random.Range(0f, 1f);

                    if (random < 0.1f)
                    {
                        if (random < 0.05f)
                        {
                            if (random < 0.005f)
                            {
                                _elementService.CreateExsplosiveBlock(new GridPosition(column, row));
                            }
                            else
                            {
                                _elementService.CreateNotMovableBlock(new GridPosition(column, row));
                            }
                        }
                        else
                        {
                            _elementService.CreateMovableBlock(new GridPosition(column, row));
                        }
                    }
                    else
                    {
                        _elementService.CreateRandomElement(new GridPosition(column, row));
                    }
                }
            }
        }