Пример #1
0
        public void SpawnEnemies(Bounds bounds)
        {
            _enemiesContainer.DestroyChildren();
            var objects = _mapEnemies.objects;

            for (int i = 0; i < objects.Length; ++i)
            {
                Vector2 point = objects[i].position;
                if (bounds.Contains(point))
                {
                    SpawnEnemy(objects[i]);
                }
            }

            _enemiesContainer.EnableChildrenComponents <EnemyComponent>(false);
            _enemiesContainer.SetChildrenComponents <Sprite>(sprite =>
            {
                Color c      = sprite.color;
                c.R          = 127;
                c.G          = 127;
                c.B          = 127;
                sprite.color = c;
            });
            _bulletContainer.DestroyChildren();
        }
Пример #2
0
        public void SpawnItems(Bounds bounds)
        {
            _itemsContainer.DestroyChildren();
            var objects = _mapItems.objects;

            for (int i = 0; i < objects.Length; ++i)
            {
                Vector2 pos = objects[i].position;
                if (bounds.Contains(pos))
                {
                    SpawnItem(objects[i]);
                }
            }
        }