Пример #1
0
        public float GetBrightness()
        {
            var error = EVRSettingsError.None;
            var gain  = vrSettings.GetFloat("steamvr", "analogGain", ref error);

            if (error != EVRSettingsError.None)
            {
                var message = vrSettings.GetSettingsErrorNameFromEnum(error);
                throw new Exception($"Failed to get display brightness: {message}");
            }

            return((float)Math.Pow(gain, 1 / 2.2));
        }
Пример #2
0
    // Token: 0x06005ED9 RID: 24281 RVA: 0x00213320 File Offset: 0x00211720
    private void OnEnable()
    {
        this.usingSpeakers = false;
        CVRSettings settings = OpenVR.Settings;

        if (settings != null)
        {
            EVRSettingsError evrsettingsError = EVRSettingsError.None;
            if (settings.GetBool("steamvr", "usingSpeakers", ref evrsettingsError))
            {
                this.usingSpeakers = true;
                float @float = settings.GetFloat("steamvr", "speakersForwardYawOffsetDegrees", ref evrsettingsError);
                this.offset = Quaternion.Euler(0f, @float, 0f);
            }
        }
        if (this.usingSpeakers)
        {
            SteamVR_Events.NewPosesApplied.Listen(new UnityAction(this.OnNewPosesApplied));
        }
    }
Пример #3
0
    private void OnEnable()
    {
        this.usingSpeakers = false;
        CVRSettings settings = OpenVR.Settings;

        if (settings != null)
        {
            EVRSettingsError eVRSettingsError = EVRSettingsError.None;
            if (settings.GetBool("steamvr", "usingSpeakers", false, ref eVRSettingsError))
            {
                this.usingSpeakers = true;
                float @float = settings.GetFloat("steamvr", "speakersForwardYawOffsetDegrees", 0f, ref eVRSettingsError);
                this.offset = Quaternion.Euler(0f, @float, 0f);
            }
        }
        if (this.usingSpeakers)
        {
            SteamVR_Utils.Event.Listen("new_poses_applied", new SteamVR_Utils.Event.Handler(this.OnNewPosesApplied));
        }
    }