Skip to content

ModLoadSequence

When Prefab.OnPrefabsLoaded and OnAllModsLoaded fire relative to Stationpedia.Regenerate, and why Unity API calls from inside OnAllModsLoaded are safe without a main-thread dispatch.

OnPrefabsLoaded / OnAllModsLoaded main-thread timing

Prefab.OnPrefabsLoaded fires on the Unity main thread (runs synchronously inside game's main-thread loading sequence around game.cs:59080-59090, before Stationpedia.Regenerate at line 59090). OnAllModsLoaded is therefore main-thread; all Unity API calls from within it are safe without dispatching.

PowerTransmitterPlus has a MainThreadDispatcher singleton MonoBehaviour for enqueuing actions from ThreadPool-run PowerTick contexts to the main thread (used by the distance-cost multiplayer sync, not by Stationpedia integration). The StationpediaPlus library does not need this; all its work happens on main thread during OnAllModsLoaded and during the main-thread-driven Regenerate / ChangeDisplay paths.

Verification history

  • 2026-04-20: page created from the Research migration; F0219c is the primary source per MigrationMap ยง5.1. F0246 is a duplicate extraction that merges here.

Open questions

None at creation.