void Start() { // verticalSpeed = -(enemySpeed * Time.deltaTime); verticalSpeed = -enemySpeed; EnemyManager = GameObject.FindWithTag("EnemyManager").GetComponent <Spawn_Enemies>(); slowed = false; }
// Start is called before the first frame update void Start() { spawn_enemies = Player.gameObject.GetComponent <Spawn_Enemies>(); audioData = GetComponent <AudioSource>(); rend = GetComponent <Renderer>(); light = GetComponent <Light>(); }
public void OnTriggerEnter2D(Collider2D col) { levelInfo = GameObject.FindWithTag("Initiate").GetComponent <Initiate>(); EnemyManager = levelInfo.currEnemySpawner.GetComponent <Spawn_Enemies>(); if (col.gameObject.CompareTag("Enemy")) { player.health = player.health - 1; HealthText.text = "" + player.health; toDel = SearchEnemyList(col.gameObject); EnemyManager.enemyList.Remove(EnemyManager.enemyList[toDel]); Destroy(col.gameObject); } }
void Start() { towerPosition = new Vector3(xCoordinate, yCoordinate, 0f); player = GameObject.FindWithTag("player").GetComponent <Player>(); HealthText = GameObject.Find("Health Number").GetComponent <TextMeshProUGUI>(); MoneyText = GameObject.Find("Money").GetComponent <TextMeshProUGUI>(); ScoreText = GameObject.Find("Score - Text").GetComponent <TextMeshProUGUI>(); levelInfo = GameObject.FindWithTag("Initiate").GetComponent <Initiate>(); EnemyManager = levelInfo.currEnemySpawner.GetComponent <Spawn_Enemies>(); if (EnemyManager != null) { enemyManagerExists = true; } shot = false; }
public void UpdateEnemyManager(Spawn_Enemies updateToEnemyManager) { EnemyManager = updateToEnemyManager; }