Esempio n. 1
0
        private void Setup()
        {
            DontDestroyOnLoad(gameObject);

            SteamVR.Initialize(false);
            var res = SteamVR_Camera.GetSceneResolution();

            Log.Info($"SteamVR Setup - HMD Res: {res.width}x{res.height}");
            WeaponArchetypeVRData.Setup();
            SteamVR_InputHandler.Setup();
            gameObject.AddComponent <HMD>();
            gameObject.AddComponent <Controllers>();
            gameObject.AddComponent <VRKeyboard>();
            gameObject.AddComponent <VRAssets>();
            // Delay the overlay setup so we don't 'hitch' the player's camera while everything else loads.
            Invoke(nameof(VRSystems.SetupOverlay), .5f);
        }
Esempio n. 2
0
        private static void Prefix(ref Resolution res)
        {
            Resolution HMDRes = SteamVR_Camera.GetSceneResolution();

            if (VRConfig.configLightResMode.Value.Equals("75%"))
            {
                HMDRes.width  = Mathf.FloorToInt(HMDRes.width * .75f);
                HMDRes.height = Mathf.FloorToInt(HMDRes.height * .75f);
            }
            else if (VRConfig.configLightResMode.Value.Equals("50%"))
            {
                HMDRes.width  = Mathf.FloorToInt(HMDRes.width * .5f);
                HMDRes.height = Mathf.FloorToInt(HMDRes.height * .5f);
            }
            else if (VRConfig.configLightResMode.Value.Equals("30%"))
            {
                HMDRes.width  = Mathf.FloorToInt(HMDRes.width * .3f);
                HMDRes.height = Mathf.FloorToInt(HMDRes.height * .3f);
            }
            res.width  = HMDRes.width;
            res.height = HMDRes.height;
        }