using System.Collections.Generic; using System.Linq; using Continentis.MainGame.Commands; using Continentis.MainGame.UI; using SLSFramework.General; using UnityEngine; namespace Continentis.MainGame.Card { public class CardLogicComponent_SelectCustomCards : CardLogicComponentBase { public List selectedCards; /// /// 添加选择手牌的指令 /// /// 目标指令组 /// 可供选择的卡牌列表 /// 选择卡牌的描述性标题 /// 最大选择数量 /// 是否强制选择最大数量 public void AddSelectionCommands(ref CommandGroup commandGroup, List cardsToSelect, string title, int maxSelection, bool forceMax = false) { selectedCards = new List(); CustomCardSelectionInterface customCardSelector = CombatUIManager.Instance.combatMainPage.customCardSelector; commandGroup.AddCommand(new Cmd_Function(() => { customCardSelector.Setup(title, mainLogic.card, cardsToSelect, maxSelection, forceMax); })); commandGroup.AddCommand(new Cmd_WaitForUI(customCardSelector)); commandGroup.AddCommand(new Cmd_Function(() => { selectedCards = customCardSelector.selectedCards.ToList(); selectedCards.ForEach(SelectEffect); })); } /// /// 卡牌被选择后的效果 /// public void SelectEffect(CardInstance card) { } } }