๐Mod Reload
Introduction
This can be said to be the most technical aspect of the entire NML, but its usage is very simple.
You only need to add [Hotfixable] for a method and set Config.isEditor=true and then click button.
The function is often used to debug. Consider such a scene:
Here is a bug. It needs a lot of time to trigger.
The bug will disappear after save-load.
The bug will keep a long time after appearing.If you add log and restart game once and once again to get information of the bug, it wastes a lot of time.
If you uses the function, you can pause game, and modify your mod code, add log or even try to fix the bug. Then click button to reload your mod, you can see result.
Except above, you can use it on UI designing.
Usage
Implement
IReloadableand setConfig.isEditor=trueLaunch game
Meet problem
Add
Hotfixableattribute to methods to modifyModify methods
Click Reload Button of your mod
Example
No video now.
Tips
You cannot add
HotfixabletoMonoBehaviour's methods such asAwake,UpdateYou cannot add
Hotfixableto constructor or deconstructor of a classYou can add
HotfixabletoReloadYou can add
Hotfixableat runtimeYou can create a new method at runtime through
HotfixableYou can add
Hotfixableto lambda method, like below:
trait.action_special_effect = [Hotfixable] (pTarget, pTile) =>
{
LogService.LogInfo("Before hotfixed trait action");
}Last updated