using BepInEx.Configuration;
using BepInEx.Logging;
using UnityEngine;
namespace BepInEx
{
///
/// The base plugin type that is used by the BepInEx plugin loader.
///
public abstract class BaseUnityPlugin : MonoBehaviour
{
///
/// Information about this plugin as it was loaded.
///
public BepInPlugin Metadata { get; }
///
/// Logger instance tied to this plugin.
///
protected ManualLogSource Logger { get; }
///
/// Default config file tied to this plugin. The config file will not be created until
/// any settings are added and changed, or is called.
///
protected ConfigFile Config { get; }
///
/// Create a new instance of a plugin and all of its tied in objects.
///
protected BaseUnityPlugin()
{
Metadata = MetadataHelper.GetMetadata(this);
Logger = Logging.Logger.CreateLogSource(Metadata.Name);
Config = new ConfigFile(Utility.CombinePaths(Paths.ConfigPath, Metadata.GUID + ".cfg"), false, this);
}
}
}