mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
mono/il2cpp config
This commit is contained in:
1 parent
e16d9119d1
commit
65281aeebc
59 files changed
+773
-146
No files matched your search
@@ -4,9 +4,13 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using BepInEx;
|
||||
using BepInEx.Bootstrap;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
#if IL2CPP
|
||||
using BepInEx.Unity.IL2CPP;
|
||||
#else
|
||||
using BepInEx.Bootstrap;
|
||||
#endif
|
||||
|
||||
namespace EHR.Modules;
|
||||
|
||||
@@ -176,7 +180,11 @@ public static class LevelImposterCompatibility
|
||||
if (_initialized) return;
|
||||
_initialized = true;
|
||||
|
||||
#if IL2CPP
|
||||
if (!IL2CPPChainloader.Instance.Plugins.TryGetValue(LevelImposterGuid, out PluginInfo plugin))
|
||||
#else
|
||||
if (!Chainloader.PluginInfos.TryGetValue(LevelImposterGuid, out PluginInfo plugin))
|
||||
#endif
|
||||
{
|
||||
Logger.Info("[LI] Not found, skipping", "LI");
|
||||
return;
|
||||
|
||||
@@ -4,9 +4,14 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using BepInEx;
|
||||
using BepInEx.Bootstrap;
|
||||
using EHR.Patches;
|
||||
using HarmonyLib;
|
||||
#if IL2CPP
|
||||
using BepInEx.Unity.IL2CPP;
|
||||
#else
|
||||
using BepInEx.Bootstrap;
|
||||
#endif
|
||||
|
||||
|
||||
namespace EHR;
|
||||
|
||||
@@ -26,7 +31,11 @@ public static class SubmergedCompatibility
|
||||
|
||||
// public static SemanticVersioning.Version Version { get; private set; }
|
||||
public static bool Loaded { get; set; }
|
||||
#if IL2CPP
|
||||
private static BasePlugin Plugin { get; set; }
|
||||
#else
|
||||
private static BaseUnityPlugin Plugin { get; set; }
|
||||
#endif
|
||||
private static Assembly Assembly { get; set; }
|
||||
private static Type[] Types { get; set; }
|
||||
// public static Dictionary<string, Type> InjectedTypes { get; private set; }
|
||||
@@ -97,10 +106,18 @@ public static class SubmergedCompatibility
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
#if IL2CPP
|
||||
Loaded = IL2CPPChainloader.Instance.Plugins.TryGetValue(SubmergedGuid, out PluginInfo plugin);
|
||||
#else
|
||||
Loaded = Chainloader.PluginInfos.TryGetValue(SubmergedGuid, out PluginInfo plugin);
|
||||
#endif
|
||||
if (!Loaded) return;
|
||||
|
||||
#if IL2CPP
|
||||
Plugin = plugin!.Instance as BasePlugin;
|
||||
#else
|
||||
Plugin = plugin!.Instance;
|
||||
#endif
|
||||
// Version = plugin.Metadata.Version;
|
||||
|
||||
Assembly = Plugin!.GetType().Assembly;
|
||||
|
||||
Reference in new issue
Block a user