mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Address code review round 2
This commit is contained in:
1 parent
b688bfa978
commit
bfc539bd74
7 files changed
+75
-52
No files matched your search
@@ -23,8 +23,15 @@ public abstract class BaseUnityPlugin : MonoBehaviour, IPlugin
|
||||
throw new InvalidOperationException("Can't create an instance of " + GetType().FullName +
|
||||
" because it inherits from BaseUnityPlugin and the BepInPlugin attribute is missing.");
|
||||
|
||||
Info = BaseChainloader<BaseUnityPlugin>.GetPluginInfoFromGuid(metadata.GUID);
|
||||
Info.Instance = this;
|
||||
if (BaseChainloader<BaseUnityPlugin>.Instance.TryGetPluginInfoFromGuid(metadata.GUID, out var pluginInfo))
|
||||
{
|
||||
Info = pluginInfo;
|
||||
Info.Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException($"The plugin information for {metadata.GUID} couldn't be found on the chainloader");
|
||||
}
|
||||
|
||||
Logger = BepInEx.Logging.Logger.CreateLogSource(metadata.Name);
|
||||
|
||||
|
||||
Reference in new issue
Block a user