internal static void Postfix(uGUI_MainMenu __instance) { if (Main.helperRoot != null) { Object.DestroyImmediate(Main.helperRoot); } Main.helperRoot = new GameObject("ModdedArmsHelper"); Main.helperRoot.transform.SetParent(uGUI.main.transform, false); SNLogger.Debug("'ModdedArmsHelper' child gameObject created in 'uGUI.main'"); Main.helperRoot.AddComponent <ArmRegistrationListener>(); SNLogger.Debug("'RegistrationListener' attached to 'ModdedArmsHelper'"); if (Main.graphicsRoot != null) { Object.DestroyImmediate(Main.graphicsRoot); } Main.graphicsRoot = new GameObject("GraphicsRoot"); Main.graphicsRoot.transform.SetParent(Main.helperRoot.transform, false); Main.graphicsRoot.AddComponent <ArmsGraphics>(); SNLogger.Debug("'GraphicsRoot' child gameObject created in 'ModdedArmsHelper'"); }
internal static void Postfix(uGUI_MainMenu __instance) { if (uGUI.main.gameObject.transform.Find("ScreenCanvas/SeaTruckResourceTracker") == null) { GameObject SeaTruckResourceTracker = new GameObject("SeaTruckResourceTracker", new Type[] { typeof(RectTransform) }); SeaTruckResourceTracker.transform.SetParent(uGUI.main.gameObject.transform.Find("ScreenCanvas").transform, false); SeaTruckResourceTracker.layer = 5; RectTransform rt = SeaTruckResourceTracker.GetComponent <RectTransform>(); rt.anchorMin = new Vector2(0, 0); rt.anchorMax = new Vector2(1, 1); rt.anchoredPosition = new Vector2(0, 0); rt.sizeDelta = new Vector2(0, 0); rt.pivot = new Vector2(0.5f, 0.5f); rt.anchoredPosition3D = new Vector3(0.0f, 0.0f, 0.0f); rt.offsetMin = new Vector2(0, 0); rt.offsetMax = new Vector2(0, 0); rt.position = new Vector3(21.0f, 0.0f, 0.0f); rt.localPosition = new Vector3(0.0f, 0.0f, 0.0f); rt.eulerAngles = new Vector3(0.0f, 90.0f, 0.0f); rt.localEulerAngles = new Vector3(0.0f, 0.0f, 0.0f); rt.right = new Vector3(0.0f, 0.0f, -1.0f); rt.up = new Vector3(0.0f, 1.0f, 0.0f); rt.forward = new Vector3(1.0f, 0.0f, 0.0f); rt.localScale = new Vector3(1.0f, 1.0f, 1.0f); SeaTruckResourceTracker.AddComponent <uGUI_SeaTruckResourceTracker>(); } }
public static void MainMenuAwake_Postfix(uGUI_MainMenu __instance) { GameObject gameObject = __instance.transform.Find("Panel").Find("MainMenu").gameObject; if (gameObject != null) { gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(0f, 385f); return; } Debug.Log("VR Enhancements Mod: Cannot set Main Menu Postions. MainMenu Not Found"); }
static void Postfix(uGUI_MainMenu __instance) { //shift the main menu up a little. Fix this. Possibly make the menu track the players head with a delay. GameObject mainMenu = __instance.transform.Find("Panel").Find("MainMenu").gameObject; if (mainMenu != null) { mainMenu.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 385); return; } }
public static void Postfix(uGUI_MainMenu __instance) { // If the player starts the main menu for the first time, or returns from a (multiplayer) session, get rid of all the patches if applicable. Main.Restore(); new GameObject().AddComponent <MultiplayerButton>(); }
public static void Prefix(uGUI_MainMenu __instance) { new GameObject().AddComponent <MainMenuModsButton>(); Patcher.PatchAll(SubPatchType.ModInitialize); }
public static void Postfix(uGUI_MainMenu __instance) { new GameObject().AddComponent <MultiplayerButton>(); }