Ejemplo n.º 1
0
    private void Update()
    {
        float timeToNextWave = enemyWaveManager.GetTimeToNextWave();

        if (timeToNextWave < 0f)
        {
            SetWaveTimerText("");
            _newWave = true;
        }
        else
        {
            if (_newWave)
            {
                _newWave = false;
                Vector3 enemyDir = (enemyWaveManager.GetNextSpawnPoint() - _cam.transform.position).normalized;
                spawnPositionIndicator.eulerAngles      = new Vector3(0, 0, Utils.VectorAngle(enemyDir));
                spawnPositionIndicator.anchoredPosition = enemyDir * 300f;
            }
            SetWaveTimerText("Next wave in " + timeToNextWave.ToString("F1") + " secs");
        }
    }