private void Start() { health = GetComponent <NecromancerHealth>(); // On hard mode is not showing the whole second dimension so then start attacking earlier: int firstAttackTime = (Settings.Difficulty != Settings.GameDifficulty.Hard) ? 9 : 3; Invoke("Attack", firstAttackTime); }
private void OnTriggerEnter2D(Collider2D collider) { if (collider.tag.StartsWith("Enemy")) { EnemyHealth health = collider.GetComponent <EnemyHealth>(); health.HitEnemy(); } else if (collider.name.Equals("Necromancer")) { NecromancerHealth health = collider.GetComponent <NecromancerHealth>(); health.HitNecro(); } }