private bool DoCollideWithColl(Collider2D col) { if (col == null) { return(false); } // Check the obvious. if (!col.isTrigger) { return(true); } // NOT a trigger? Yeah, we collide! if (LayerUtils.IsLayerInLayermask(col.gameObject.layer, lm_triggerColls)) { return(true); } // It's a trigger, BUT its layer is in my triggers-I-collide-with mask! return(false); // Nah, don't collide. }