-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.cs
More file actions
45 lines (36 loc) · 1.27 KB
/
Copy pathMain.cs
File metadata and controls
45 lines (36 loc) · 1.27 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
using System.Collections;
using System.Linq;
using GHPC.State;
using MelonLoader;
using ModNameSpace;
using ModUtil;
[assembly: MelonInfo(typeof(Mod), "Mod Name", "1.0.0", "Author")]
[assembly: MelonGame("Radian Simulations LLC", "GHPC")]
namespace ModNameSpace
{
public class Mod : MelonMod
{
private ModuleManager module_manager;
internal IEnumerator OnGameReady(GameState _)
{
module_manager.LoadAllDynamicAssets();
yield break;
}
public override void OnInitializeMelon()
{
module_manager = new ModuleManager("InternalModName");
// module_manager.Add("ModuleName", new Module());
}
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
module_manager.UnloadAllDynamicAssets();
if (sceneName == "MainMenu2_Scene" || sceneName == "MainMenu2-1_Scene" || sceneName == "t64_menu")
{
module_manager.LoadAllStaticAssets();
AssetUtil.ReleaseVanillaAssets();
}
if (Util.menu_screens.Contains(sceneName)) return;
StateController.RunOrDefer(GameState.GameReady, new GameStateEventHandler(OnGameReady), GameStatePriority.Medium);
}
}
}