Mod Interface
Last updated
Last updated
NCMS uses ModEntry
attribute to locate mod's entry. NML recognizes mod main class by IMod
interface.
Mod main class needs to be child class of MonoBehaviour
.
Except IMod
, NML provides IConfigurable
(Mod configuration), ILocalizable
(Auto multigual), IReloadable
(Method hotfix) and so on(more interfaces will be added in the future).
It is hard to implement too many interfaces. So there is which implements IMod
, IConfigurable
, ILocalizable
already and provides some useful functions.
It is always used for mod main class. If you implements it manually, the class should also inherit from MonoBehaviour
.
IMod
requires to implement the following four methods
If a mod's main class implements IConfigurable
, you can see an entry button of configuration window for the mod.
IConfigurable
requires to implement the following method
If a mod's main class implements ILocalizable
, NML will load its locales text before OnLoad
ILocalizable
requires to implement the following method
If a mod's main class implements IReloadable
and set Config.isEditor=true
, you can see a reload button for your mod.
Limit Config.isEditor=true
is to avoid users to click reload button carelessly.
IReloadable
requires to implement the following method
See more about ModConfig
in
Except IReloadable
, NML also provides Hotfixable
attribute for method. It marks what method to be hotfixed. See more in