void StartValheimVR() { HarmonyPatcher.DoPatching(); if (VHVRConfig.NonVrPlayer()) { LogDebug("Non VR Mode Patching Complete."); return; } if (VRManager.InitializeVR()) { VRManager.StartVR(); vrPlayer = new GameObject("VRPlayer"); DontDestroyOnLoad(vrPlayer); vrPlayer.AddComponent <VRPlayer>(); vrGui = new GameObject("VRGui"); DontDestroyOnLoad(vrGui); vrGui.AddComponent <VRGUI>(); if (VHVRConfig.RecenterOnStart()) { VRManager.tryRecenter(); } } else { LogError("Could not initialize VR."); enabled = false; } }
void Update() { if (VHVRConfig.NonVrPlayer()) { return; } if (Input.GetKeyDown(VHVRConfig.GetRecenterKey())) { VRManager.tryRecenter(); } #if DEBUG if (Input.GetKeyDown(KeyCode.Backslash)) { // dumpall(); } #endif }