예제 #1
0
        /// <summary>
        /// 读取平台默认品质级别
        /// </summary>
        /// <param name="item">包含平台默认品质级别数据对象</param>
        /// <returns></returns>
        private PlatformDefaultQuality[] ReadPlatformDefaultQuality(YamlMappingNode item)
        {
            List <PlatformDefaultQuality> list = new List <PlatformDefaultQuality>();

            foreach (var platform in item)
            {
                PlatformDefaultQuality platformDefaultQuality = new PlatformDefaultQuality();
                platformDefaultQuality.platform     = platform.Key.ToString();
                platformDefaultQuality.qualityLevel = int.Parse(platform.Value.ToString());
                list.Add(platformDefaultQuality);
            }
            return(list.ToArray());
        }
예제 #2
0
        /// <summary>根据平台名称返回平台默认的品质级别</summary>
        private int GetDefaultQualityLevelWithPlatformName(QualityData qualityData, string platformName)
        {
            PlatformDefaultQuality[] platformDefaultQualities = qualityData.perPlatformDefaultQuality;
            int len = platformDefaultQualities.Length;

            for (int i = 0; i < len; i++)
            {
                PlatformDefaultQuality platformDefaultQuality = platformDefaultQualities[i];
                if (platformDefaultQuality.platform == platformName)
                {
                    return(platformDefaultQuality.qualityLevel);
                }
            }
            Debug.LogError("没找到" + platformName + "平台的默认品质级别,请确认平台:" + platformName + "是否存在。");
            return(-1);
        }