-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntryPoint.cs
76 lines (69 loc) · 2.16 KB
/
EntryPoint.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MelonLoader;
using UML;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: MelonInfo(typeof(BoomerMod.EntryPointMelon), "BoomerMod", "1.0.0", "devilExE")]
[assembly: MelonGame("Dani", "Karlson")]
namespace BoomerMod
{
class EntryPointMelon : MelonMod
{
public override void OnApplicationLateStart()
{
SceneManager.sceneLoaded += OnSceneLoaded;
}
static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (scene.name == "MainMenu" && !Prefabs.Initialized)
{
SceneManager.LoadScene("0Tutorial");
return;
}
if (scene.name == "0Tutorial" && !Prefabs.Initialized)
{
Prefabs.LoadPrefabs();
return;
}
}
}
[ModInfo(GUID, "BoomerMod", "1.0.0", "devilexe")]
class EntryPointUML : IMod
{
public const string GUID = "me.devilexe.boomermod";
public static GameObject UML;
public static BM_MonoHooks MB_Hooks;
void IMod.Start()
{
CompatibilityModule.IsMelonLoader = false;
HarmonyLib.Harmony harmony = new HarmonyLib.Harmony(GUID);
harmony.PatchAll();
UML = GameObject.Find("KarlsonLoader_MonoHooks");
MB_Hooks = UML.AddComponent<BM_MonoHooks>();
CompatibilityModule.prefabSet = new PrefabUMLCompatibility();
}
void IMod.FixedUpdate(float fixedDeltaTime) { }
void IMod.OnApplicationQuit() { }
void IMod.OnGUI() { }
void IMod.Update(float deltaTime) { }
}
class CompatibilityModule
{
public static bool IsMelonLoader = true;
public static IPrefabsSet prefabSet;
public static object StartCoroutine(IEnumerator coroutine)
{
if(IsMelonLoader)
return MelonCoroutines.Start(coroutine);
return EntryPointUML.MB_Hooks.StartCoroutine(coroutine);
}
}
interface IPrefabsSet
{
GameObject CreateBoomer();
}
}