Details
Target: Obenseuer 0.5.08 (buildid 25969064), Unity 6000.0.77f1 Mono, BepInEx 6 Unity.Mono (be.788, the tested build) or BepInEx 5 (5.4.23 or later). Namespace: ObenseuerCore. Logs go to BepInEx\logs\obenseuer.moddingframework.doors.log.
Everything not listed in this reference is internal and may change without notice.
If something fails to set up
The framework changes two of the game’s methods when it starts, so it can tell your mod when a door has opened or closed. If a game update breaks either one, both events turn off, and the framework writes error lines and a warning to the log. The rest of the API keeps working: the reads, Open and Close. The two changes belong to one feature group, obenseuer.moddingframework.doors, the name you will see in the log.
Doors.IsAvailabletells you whetherOpenedandClosedwork. It isfalsewhen the changes could not be made or the feature group was turned off. (CorePatcher.IsDisabled("obenseuer.moddingframework.doors")is then true. The patched methods areOnFullyOpenandOnFullyClosedonDoor, and the game has one version of each.)
When you can call it
- Call everything from your mod’s normal code (OnLoad, event handlers, Update), not from a background thread you started. The game only runs safely on the main thread (see the glossary).
- It is safe to call any of it at any time, even on the main menu. With no scene loaded, the reads give an empty list,
nullorfalse. - Nothing throws an error. An id that is empty or not known gives
false(ornullforGetandOpeningTimes). - Your event handlers run inside the game’s own door update, one at a time. If a handler throws an error, the framework logs it and still runs the other handlers.
Limits
- Each read searches every door in the scene. That is fine now and then, but do not call these on every frame. (Each call runs
FindObjectsByType<Door>.)
Save loads
The framework does not hold back the events while a save loads. A handler that should ignore events raised while a save loads can check SaveData.Busy, which is true while a save is loading or being written.