Can anyone help out, I have implemented the load default config override and Config.WriteObject of class Plugin config.
when i Init it fails with a null reference exception. I have followed the advanced example here:
https://umod.org/documentation/api/configuration
private class PluginConfig
{
public float LaptopDistance;
public bool CanOpenDoors;
}
private PluginConfig config;
private void Init()
{
try
{
config = Config.ReadObject<PluginConfig>();
}
catch (Exception ex)
{
Console.Write(ex);
}
}
protected override void LoadDefaultConfig()
{
Config.WriteObject(GetDefaultConfig(), true);
}
private PluginConfig GetDefaultConfig()
{
return new PluginConfig
{
CanOpenDoors = true,
LaptopDistance = 1f
};
}