/* * This method is executed right after the mod is loaded by the game. */ public void OnLoaded() { // logged text can be read in output_log.txt file in LocalLow folder; it should also appear in the in-game console Debug.Log("Hello! Scripting samples mod is loaded."); // tell Harmony to apply patches from this mod var harmony = HarmonyInstance.Create("com.dws.uboat"); harmony.PatchAll(); // register custom commands for the in-game console DevConsole.AddListener("HelloWorld", ConsoleCommands.HelloWorld); DevConsole.AddListener("Gravity", ConsoleCommands.Gravity); // listen for the main scene loading to spawn custom UI SceneEventsListener.OnSceneAwake += SceneEventsListener_OnSceneAwake; }