예제 #1
0
        public List <Ammunition> Spawn(int amount)
        {
            var list = new List <Ammunition>(amount);

            for (int i = 0; i < amount; i++)
            {
                var ammunition = spawner.Spawn();

                ammunition.transform.position = spawnPoints[Random.Range(0, spawnPoints.Length)].position;
                ammunition.gameObject.SetActive(true);
                list.Add(ammunition);
            }

            return(list);
        }
        public List <Enemy> Spawn(int amount)
        {
            var enemies = new List <Enemy>(amount);

            for (int i = 0; i < amount; i++)
            {
                Enemy item = spawner.Spawn();

                item.transform.position = spawnPoints[Random.Range(0, spawnPoints.Length)].position;
                item.gameObject.SetActive(true);
                item.enabled = true;
                enemies.Add(item);
            }

            return(enemies);
        }
        public List <Transform> Spawn(int amount)
        {
            var list = new List <Transform>();

            var poinst = spawnPoints.OrderBy(d => Guid.NewGuid()).ToArray();

            for (int i = 0; i < amount; i++)
            {
                var bush = spawner.Spawn();
                bush.transform.position = poinst[i].position;
                bush.gameObject.SetActive(true);
                list.Add(bush);
            }

            return(list);
        }