Пример #1
0
    public void Update()
    {
        if (!spawnQueue.Any())
        {
            return;
        }

        spawnTime -= Time.deltaTime;
        if (spawnTime > 0)
        {
            return;
        }


        GhostPlatoonBehaviour ghostPlatoon = spawnQueue.Dequeue();

        ghostPlatoon.Spawn(transform.position);

        if (spawnQueue.Count > 0)
        {
            spawnTime += MIN_SPAWN_INTERVAL;
        }
        else
        {
            spawnTime = QUEUE_DELAY;
        }
    }
Пример #2
0
        private void Update()
        {
            if (!_spawnQueue.Any())
            {
                return;
            }

            _spawnTime -= Time.deltaTime;
            if (_spawnTime > 0)
            {
                return;
            }


            GhostPlatoonBehaviour previewPlatoon = _spawnQueue.Dequeue();

            previewPlatoon.Spawn(transform.position);

            if (_spawnQueue.Count > 0)
            {
                _spawnTime += Constants.SPAWNPOINT_MIN_SPAWN_INTERVAL;
            }
            else
            {
                _spawnTime = Constants.SPAWNPOINT_QUEUE_DELAY;
            }
        }