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); }
private void Awake() { if (instance == null) { instance = this; } scoreText = GameObject.FindWithTag(Tags.SCORE).GetComponent <Text>(); }
public virtual void ResetSerial (string counterObject, string counterName, float startTime, float repeatTime) { counter = (WaveCounter) ExtendBehaviour.FindComponent(counterObject, counterName); timeBeforeStart = startTime; timeRepeat = repeatTime; }
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 } }
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"); } }
private void Awake() { instance = this; }