using UnityEngine;

namespace NBF.Setting
{
    /// <summary>
    /// 垂直同步
    /// </summary>
    [Sort(4)]
    public class VSyncSetting : ToggleOption
    {
        public override string Name => "VSync";

        public override string Group => SettingsDef.Group.Graphic;
        public override string Tab => SettingsDef.Tab.Graphic;
        protected override int DefaultValue => 0;

        protected override void OnApply()
        {
            //垂直同步
            QualitySettings.vSyncCount = GetSelectedOption() ? 1 : 0;
        }
    }
}