namespace XGame.Framework.Quality
{
    public enum XQualityLevel
    {
        UnKnow = -1,
        Low = 0, // 与unity的QualitySettings对应
        Medium = 1,
        High = 2,
        UltraHD = 3, //超高清
    }

    public static class QualityLevelExt
    {
        /// <summary>
        /// 判断一个QualityLevel是否可以使用LOD
        /// </summary>
        /// <param name="quality"></param>
        /// <returns></returns>
        public static bool IsLodQuality(this XQualityLevel quality)
        {
            return quality == XQualityLevel.High || quality == XQualityLevel.Low || quality == XQualityLevel.UltraHD;
        }
        public static int ShaderLodLevel(this XQualityLevel level)
        {
            switch (level)
            {
                case XQualityLevel.Low:
                    return 1000;
                case XQualityLevel.Medium:
                    return 2000;
                default:
                    return int.MaxValue;
            }
        }
    }
}
