namespace UXAssist.Common.ModFeatures; /// /// Interface implemented by instance mod features registered with . /// The registry drives the lifecycle; individual mods never call these methods directly. /// /// /// /// Timing contract. The registry guarantees the following relative ordering, which /// feature implementations may rely on: /// /// /// runs eagerly at registration time — synchronously inside /// , during the registering mod's BepInEx Awake phase. /// It therefore completes before the game scene loads, before any game object's /// Start, and before the host mod's . This is the only phase where /// early setup that must precede game initialization (e.g. keybind registration via CommonAPI's /// CustomKeyBindSystem, whose registered bindings are copied by the game's /// UIOptionWindow._OnCreate only after all plugins finish loading) can safely run. Implementations /// must not depend on the game being loaded here. /// runs once during the host mod's (UXAssist) Start, /// which is guaranteed to occur after every mod's Awake has finished (BepInEx runs all /// plugins' Awake synchronously during load, before Unity dispatches any Start). This is /// the phase for activating behavior that requires the game/runtime to be ready. It is driven solely by /// UXAssist; dependent mods must not start features themselves. /// runs during the host's teardown (OnDestroy) and resets the feature /// so it could be started again. /// and are called every frame by UXAssist; the /// registry guarantees at most one invocation per frame even if multiple drivers exist. /// /// /// The same timing contract applies to static features discovered via ; /// see that attribute for details. /// /// public interface IModFeature { /// /// Called eagerly at registration time, during the registering mod's Awake phase, before the /// game scene loads and before any plugin's . Use this for early setup that must /// precede game initialization (e.g. keybind registration). Do not depend on the game being loaded /// here. Runs at most once per registration. /// void Init(); /// /// Called once during the host mod's (UXAssist) Start, after all mods have finished /// Awake (and thus after every feature's ). Use this to activate behavior /// that requires the game/runtime to be ready. Driven solely by UXAssist; runs at most once /// (a repeated driver call is a no-op for an already-started feature). /// void Start(); /// /// Called during the host's teardown (OnDestroy). Reset any state created in /// / so the feature could be re-started. Runs on every /// registered feature. /// void Uninit(); /// /// Called every frame for input handling. Should be lightweight. The registry guarantees at most /// one invocation per frame. /// void OnInputUpdate(); /// /// Called every frame for general updates. Should be lightweight. The registry guarantees at most /// one invocation per frame. /// void OnUpdate(); }