mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Add temporary instance property to Unity and .NET chainloaders
This commit is contained in:
1 parent
5f13a91292
commit
9cc85135dd
2 files changed
+15
-1
No files matched your search
@@ -7,11 +7,20 @@ namespace BepInEx.NetLauncher.Common
|
||||
{
|
||||
public class NetChainloader : BaseChainloader<BasePlugin>
|
||||
{
|
||||
// TODO: Remove once proper instance handling exists
|
||||
public static NetChainloader Instance { get; set; }
|
||||
|
||||
public override void Initialize(string gameExePath = null)
|
||||
{
|
||||
Instance = this;
|
||||
base.Initialize(gameExePath);
|
||||
}
|
||||
|
||||
public override BasePlugin LoadPlugin(PluginInfo pluginInfo, Assembly pluginAssembly)
|
||||
{
|
||||
var type = pluginAssembly.GetType(pluginInfo.TypeName);
|
||||
|
||||
var pluginInstance = (BasePlugin)Activator.CreateInstance(type);
|
||||
var pluginInstance = (BasePlugin) Activator.CreateInstance(type);
|
||||
|
||||
pluginInstance.Load();
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ public class UnityChainloader : BaseChainloader<BaseUnityPlugin>
|
||||
|
||||
private string _consoleTitle;
|
||||
|
||||
// TODO: Remove once proper instance handling exists
|
||||
public static UnityChainloader Instance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The GameObject that all plugins are attached to as components.
|
||||
/// </summary>
|
||||
@@ -60,6 +63,8 @@ public class UnityChainloader : BaseChainloader<BaseUnityPlugin>
|
||||
|
||||
public override void Initialize(string gameExePath = null)
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
UnityTomlTypeConverters.AddUnityEngineConverters();
|
||||
|
||||
ThreadingHelper.Initialize();
|
||||
|
||||
Reference in new issue
Block a user