private void Die() { if (gameObject.layer == 8) { defenderSpawner.RemoveDefenderFromList(gameObject.GetComponent <Defender>()); } TriggerDeathVFX(); gameObject.SetActive(false); Destroy(gameObject); }