Пример #1
0
        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;
            }
        }
Пример #2
0
 void StartValheimVR()
 {
     HarmonyPatcher.DoPatching();
     if (VRManager.InitializeVR())
     {
         VRManager.StartVR();
         vrPlayer = new GameObject("VRPlayer");
         DontDestroyOnLoad(vrPlayer);
         VRPlayer playerComponent = vrPlayer.AddComponent <VRPlayer>();
         vrGui = new GameObject("VRGui");
         DontDestroyOnLoad(vrGui);
         vrGui.AddComponent <VRGUI>();
     }
     else
     {
         LogError("Could not initialize VR.");
         enabled = false;
     }
 }