hch
2026-01-26 d613ac4b9deae55e86dfef5f5b971f8314029ddb
Main/System/FuncPreset/FuncPresetChooseCells.cs
@@ -14,13 +14,17 @@
public class FuncPresetChooseCells : MonoBehaviour
{
    [SerializeField] HorizontalLayoutGroup layoutGroup;
    [SerializeField] FuncPresetChooseCell[] cells;
    [SerializeField] Button unFoldBtn;   //展开更多
    //被选中的方案会显示在外层,如果不是第四个则第四个会显示在最上面
    [SerializeField] Transform moreCellObj;
    [SerializeField] FuncPresetChooseMoreCell[] moreCells;
    bool forceUnFold = false; //强制展开,不能收缩; 流派界面的需求
    [NonSerialized] public int unFoldID = 0;    //当前展开的方案ID,在选中的情况下才生效
    int curBattleType;
    /// <summary>
    /// 显示方案预设
@@ -37,6 +41,10 @@
        var selectID = FuncPresetManager.Instance.GetFuncPresetIDByBattleType(battleType, funcType);
        var showCount = FuncPresetManager.Instance.GetShowFuncPresetCount(funcType);
        unFoldBtn.SetActive(showCount > 4);
        unFoldBtn.AddListener(() =>
        {
            moreCellObj.SetActive(true);
        });
        for (int i = 0; i < cells.Length; i++)
        {
@@ -62,7 +70,7 @@
        }
        var showMoreCount = showCount - 4;
        for (int i = 0; i < showMoreCount; i++)
        for (int i = 0; i < moreCells.Length; i++)
        {
            if (i < showMoreCount)
            {
@@ -98,4 +106,11 @@
    {
        Display(curBattleType, funcType, forceUnFold);
    }
    //默认是居中靠右
    public void ChangeAlignment(TextAnchor type)
    {
        layoutGroup.childAlignment = type;
    }
}