Beispiel #1
0
 public virtual void Spawn(Vector3 target)
 {
     Capacity--;
     _command.Spawn(
         Vector3.Lerp(_leftBorder.position, _rightBorder.position, Random.value),
         target,
         _currentLevel
         );
 }
Beispiel #2
0
        protected void SpawnOthers(Vector3 position)
        {
            HashSet <int> positions  = new HashSet <int>();
            int           splitCount = Random.Range(2, Mathf.Max(2, _level - 1));

            while (positions.Count < splitCount)
            {
                positions.Add(Random.Range(0, _targets.Length));
            }

            foreach (var index in positions)
            {
                _spawnOthersCommand.Spawn(position, _targets[index], _level);
            }
        }
Beispiel #3
0
 public void Spawn(Vector3 target)
 {
     Capacity--;
     _command.Spawn(transform.position, target, _level);
 }