private void OnTriggerEnter2D(Collider2D c) { if (c.tag == "Arrow") { if (c.GetComponent <Projectile>().ShooterTag == transform.tag) { return; } Destroy(c.gameObject); StartCoroutine(HitAnimation()); enemy.DecreaseHealth(baseClass.DamageOutput); if (enemy.Health <= 0) { FindObjectOfType <EnemySpawner>().Enemies.Remove(this.gameObject.GetComponent <Enemy>()); enemyManager.AddCoins((int)enemyManager.WarriorStats[enemyManager.CoinIndex]); Destroy(gameObject); } } }