hch
11 小时以前 1652c9ba3abc80d59f540c7e0d25793041251174
Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
1个文件已修改
26 ■■■■■ 已修改文件
Main/System/Attribute/AttributeManager.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Attribute/AttributeManager.cs
@@ -78,7 +78,7 @@
            if (!PlayerPropertyConfig.HasKey(kvp.Key))
                continue;
            PlayerPropertyConfig config = PlayerPropertyConfig.Get(kvp.Key);
            if (kvp.Value > 0 && config.showType > 0 && config.showType < 5)
            if (kvp.Value > 0 && config.showType > 0)
            {
                result.Add(kvp.Key, kvp.Value);
            }
@@ -109,7 +109,11 @@
            int showTypeB = configB?.showType ?? 0;
            if (showTypeA != showTypeB)
                return showTypeA.CompareTo(showTypeB);
            {
                int priorityA = GetShowTypePriority(showTypeA);
                int priorityB = GetShowTypePriority(showTypeB);
                return priorityA.CompareTo(priorityB);
            }
            int showSequenceA = configA?.showSequence ?? 0;
            int showSequenceB = configB?.showSequence ?? 0;
@@ -120,4 +124,22 @@
        });
        return list;
    }
    /// <summary>
    /// 获取showType的优先权,值越小越靠前
    /// 优先权顺序:[1,6,2,3,4,5],其他值排在最后
    /// </summary>
    private int GetShowTypePriority(int showType)
    {
        return showType switch
        {
            1 => 0,   // 最高优先权
            6 => 1,
            2 => 2,
            3 => 3,
            4 => 4,
            5 => 5,
            _ => 999  // 未定义的showType排在最后
        };
    }
}