I have a 2d tilemap collider combined with a 2d composite collider to and set to be a trigger. What I want to do is check if there are any game objects within that trigger area. The catch however is that not all of these game objects have colliders. I cannot use collider bounds either since the trigger area can be wrapped around game objects without them being in it (see picture). At this point I have a list of game objects (got them by tag name), and I'm looping through them to check if they are in the room.
For more context, this is what is happening from the player's perspective: You're entering a procedural generated dungeon, the scene loads, and all the game objects are loaded with the scene (chests, stairs, points of interest, etc...). The dungeon is divided into sections, and as the player walks around and enters sections of the map (entering the trigger), that calls the method to find all the gameobjects of a certain tag name and check if they are in the trigger area so they can be shown on the map when the player enters that area.
public void ShowMapIconsInExposedRoom(Collider2D roomCollider)
{
foreach(GameObject go in MapIconGameObjects)
{
if (/*game object is in the room collider*/)
{
go.SetActive(true);
}
}
}