void OnTriggerEnter2D(Collider2D other) { if (ElevenTools.IsInLayerMask(other.gameObject, destroyedBy)) { Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D other) { if (ElevenTools.IsInLayerMask(other.gameObject, killingLayers)) { foreach (var toDisable in disableOnDeath) { toDisable.enabled = false; } Destroy(gameObject, timeToDie); } }