BaseUnityPlugin.cs 585 B

12345678910111213141516171819202122232425
  1. using BepInEx.Configuration;
  2. using BepInEx.Logging;
  3. using UnityEngine;
  4. namespace BepInEx
  5. {
  6. /// <summary>
  7. /// The base plugin type that is used by the BepInEx plugin loader.
  8. /// </summary>
  9. public abstract class BaseUnityPlugin : MonoBehaviour
  10. {
  11. protected ManualLogSource Logger { get; }
  12. protected ConfigFile Config { get; }
  13. protected BaseUnityPlugin()
  14. {
  15. var metadata = MetadataHelper.GetMetadata(this);
  16. Logger = Logging.Logger.CreateLogSource(metadata.Name);
  17. Config = new ConfigFile(Utility.CombinePaths(Paths.ConfigPath, metadata.GUID + ".ini"));
  18. }
  19. }
  20. }