Configs and DataStorage
On this page we will explain the built in config system as well as the predefinied data directory for your plugin.
Configs using TOML
using Onsharp.IO;
namespace Tutorial
{
[Config("myconfig")]
public class MyConfig
{
public bool IsDebug { get; set; } = false;
}
}using Onsharp.Plugins;
namespace Tutorial
{
public class PluginMain : Plugin
{
public override void OnStart()
{
//Your start up logic here
MyConfig config = Data.Config<MyConfig>();
}
public override void OnStop()
{
//Your stop and clean up logic here
}
}
}Data Storage
Last updated