forked from TheNooodle/MinishootRandomizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
65 lines (53 loc) · 1.85 KB
/
Copy pathPlugin.cs
File metadata and controls
65 lines (53 loc) · 1.85 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using BepInEx;
using UnityEngine;
namespace MinishootRandomizer
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInProcess("Minishoot.exe")]
public class Plugin : BaseUnityPlugin
{
private ILogger _logger;
public static IServiceContainer ServiceContainer { get; private set; }
public static bool IsDebug => false;
private void Awake()
{
ServiceContainer = new ComponentModelContainer(Logger);
_logger = ServiceContainer.Get<ILogger>();
// Plugin startup logic
_logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
}
private void Start()
{
CreateSceneCrawler();
CreateManager();
CreateMessageWorker();
CreateImgui();
}
private void CreateImgui()
{
GameObject imgui = new GameObject("RandomizerImgui");
imgui.AddComponent<ImguiContextComponent>();
DontDestroyOnLoad(imgui);
}
private void CreateMessageWorker()
{
GameObject messageWorker = new GameObject("RandomizerMessageWorker");
messageWorker.AddComponent<MessageWorkerComponent>();
DontDestroyOnLoad(messageWorker);
}
private GameObject CreateSceneCrawler()
{
GameObject sceneCrawler = new GameObject("SceneCrawler");
sceneCrawler.AddComponent<SceneCrawlerComponent>();
DontDestroyOnLoad(sceneCrawler);
return sceneCrawler;
}
private GameObject CreateManager()
{
GameObject manager = new GameObject("RandomizerManager");
manager.AddComponent<RandomizerManagerComponent>();
DontDestroyOnLoad(manager);
return manager;
}
}
}