예제 #1
0
    protected void Awake()
    {
        gm = FindObjectOfType <GameManager>();

        if (gm == null)
        {
            Debug.LogError($"{name}: cannot find game manager!");
        }

        waveText = FindObjectOfType <WaveText>();

        if (waveText == null)
        {
            Debug.LogError($"{name}: cannot find wave text!");
        }

        waveCounter = FindObjectOfType <WaveCounter>();

        if (waveCounter == null)
        {
            Debug.LogError($"{name}: cannot find wave counter!");
        }

        if (LevelMap == null)
        {
            Debug.LogError($"{name}: No level map assigned!");
        }

        // Register listeners
        GameStartEvent.RegisterListener(StartAssault);
    }
예제 #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     scoreText = GameObject.FindWithTag(Tags.SCORE).GetComponent <Text>();
 }
예제 #3
0
 public virtual void ResetSerial
     (string counterObject, string counterName, float startTime,
     float repeatTime)
 {
     counter =
         (WaveCounter)
         ExtendBehaviour.FindComponent(counterObject, counterName);
     timeBeforeStart = startTime;
     timeRepeat      = repeatTime;
 }
예제 #4
0
 void Start()
 {
     start       = GameObject.Find("Start").transform;
     destination = GameObject.Find("Destination").transform;
     waveCounter = GameObject.Find("GameUI/WaveCounter").GetComponent <WaveCounter>();
     waveNumber  = 1;
     if (start != null && destination != null && waveCounter != null)
     {
         InvokeRepeating("StartWaveCoroutine", 0, waveDuration); // Begins to send waves
     }
 }
예제 #5
0
 private void Start()
 {
     su            = GameObject.FindObjectOfType <ScoreUpdate>();
     waveCountdown = timeFirstWave;
     m_chrono      = GameObject.FindGameObjectWithTag("WaveChrono").GetComponent <Chrono>();
     if (m_chrono == null)
     {
         Debug.LogError("Could not find any Chrono object with tag \"Chrono\" in script WaveSpawner.cs");
     }
     m_waveCounter = GameObject.FindGameObjectWithTag("WaveCounter").GetComponent <WaveCounter>();
     if (m_waveCounter == null)
     {
         Debug.LogError("Could not find any WaveCounter object with tag \"WaveCounter\" in script WaveSpawner.cs");
     }
     if (spawnPoints.Length == 0)
     {
         Debug.LogError("Pas de points de spawn");
     }
 }
예제 #6
0
 private void Awake()
 {
     instance = this;
 }