Spawning doors in the corridor by clicking a button in the Editor

Hello guys,
Recently I have finished a door model for my game. And I have a problem, because I need to put doors in those, but:

  • I can’t add door to every doorhole, because 2 coridors will overwrite doors
  • I can’t make prefab with half of places filled, because in some cases it may not match.

So, I have an idea:
Make a script attached to corridor prefabs, and have X checkboxes (1 checkbox = 1 door). And when checkbox is checked, I want door to be spawned (in build AND in the Editor!!!)

Do you know, what’s the best way to do it?

Generally you can’t get away from these steps:

1- determine that a door needs to be placed
2- determine where the door needs to be placed
3- emplace the door

However those steps happen is going to be completely and totally dependent on your data and setup and approach.

You could put invisible markers where doors are supposed to be, then eliminate any markers that are too close to each other and only spawn a single door.