How to detect if collisions are being ignored unity 2018

In unity 2019 Unity exposed Physics.GetIngoreCollision();

How would one go about doing this in unity 2018 in a clean way?

cant you use layers? rather than ignoring collision between 2 objects set the 2 objects in the desired layer and ignore those collision you can use this method. if you cant use layers for some reason, i would create a manger for saving in a dictionary/list the objects that have been set to ignore collision but i would rather go with the first approach for better performance.

You don’t. There was no way to query this information in the past. However since you have to explicitly call Physics.IgnoreCollision to ignore / unignore collisions between two colliders you just have to track this yourself. If you want to handle this in a general manner you can use a struct with two Collider references as key into a dictionary. Keep in mind that the when you swap the two colliders it would be a different key, so you might want to either add both versions to the dictionary or when checking the state, try both versions. Which solution is better depends on what operation has to be done more often. Ignoring / unignoring collisions or querying the state