Example #1
0
        void Start()
        {
            handlerFullScreen?.Bind(Screen.fullScreen == true, val =>
            {
                if (val)
                {
                    var res = Screen.resolutions[Screen.resolutions.Length - 1];
                    Screen.SetResolution(res.width, res.height, FullScreenMode.FullScreenWindow);
                }
                else
                {
                    Screen.fullScreenMode = FullScreenMode.Windowed;
                }
            });

            handlerMasterVolume?.Bind(AudioSystem.GetVolume("VolumeMaster"), val => AudioSystem.SetVolume("VolumeMaster", val));
            handlerMusicVolume?.Bind(AudioSystem.GetVolume("VolumeMusic"), val => AudioSystem.SetVolume("VolumeMusic", val));
            handlerSoundVolume?.Bind(AudioSystem.GetVolume("VolumeSound"), val => AudioSystem.SetVolume("VolumeSound", val));

            //handlerMouseSensitivityX?.Bind(ControlSetting.mouseSensitivity.x, val => ControlSetting.mouseSensitivity.x = val);
            //handlerMouseSensitivityY?.Bind(ControlSetting.mouseSensitivity.y, val => ControlSetting.mouseSensitivity.y = val);
            //handlerInvertY?.Bind(ControlSetting.mouseInvertY, val => ControlSetting.mouseInvertY = val);
        }