BasePlugin.cs 534 B

12345678910111213141516171819202122232425262728
  1. using BepInEx.Configuration;
  2. using BepInEx.Logging;
  3. namespace BepInEx.IL2CPP
  4. {
  5. public abstract class BasePlugin
  6. {
  7. public ManualLogSource Log { get; }
  8. public ConfigFile Config { get; }
  9. protected BasePlugin()
  10. {
  11. var metadata = MetadataHelper.GetMetadata(this);
  12. Log = Logger.CreateLogSource(metadata.Name);
  13. Config = new ConfigFile(Utility.CombinePaths(Paths.ConfigPath, metadata.GUID + ".cfg"), false, metadata);
  14. }
  15. public abstract void Load();
  16. public virtual bool Unload()
  17. {
  18. return false;
  19. }
  20. }
  21. }