-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (37 loc) · 1.34 KB
/
Program.cs
File metadata and controls
43 lines (37 loc) · 1.34 KB
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
//using cookingsimulatormultiplayer.Commands;
//using cookingsimulatormultiplayer.helpers;
//using cookingsimulatormultiplayer.Util;
using HarmonyLib;
using KebabMultiplayerLimit.Util;
using System.Diagnostics;
using System.Reflection;
using UnityEngine.SceneManagement;
namespace Doorstop
{
public static class Entrypoint
{
public static void Start()
{
Harmony.DEBUG = true;
ConsoleHelper.CreateConsole();
SceneManager.sceneLoaded += SceneLoaded;
}
static bool runtime = false;
private static void Runtime()
{
//Debugger.Info("Runtime patching");
//CommandInternal.Instance = new CommandInternal();
//CommandInternal.Instance.RefreshModel();
Harmony harmony = new Harmony("KebabMultiplayerLimit.Patches.Runtime");
harmony.PatchAll(Assembly.GetExecutingAssembly());
runtime = true;
}
private static void SceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadSceneMode)
{
Logger.Info($"Scene loaded: {scene.name} ({loadSceneMode})");
// Execute patching after unity has finished it's startup and loaded at least the first game scene
if (!runtime)
Runtime();
}
}
}