Ejemplo n.º 1
0
        public static async Task WaitForSelectBoardCard <T>(List <T> CardIds, GameEnum.CardBoardMode Mode = GameEnum.CardBoardMode.Select, int num = 1)
        {
            GlobalBattleInfo.SelectBoardCardIds       = new List <int>();
            GlobalBattleInfo.IsWaitForSelectBoardCard = true;
            UiCommand.SetCardBoardShow();
            //Debug.Log("打开面板");
            if (typeof(T) == typeof(Card))
            {
                CardBoardCommand.LoadCardList(CardIds.Cast <Card>().ToList());
            }
            else
            {
                CardBoardCommand.LoadCardList(CardIds.Cast <int>().ToList());
            }
            Debug.Log("启动");

            await Task.Run(async() =>
            {
                switch (Mode)
                {
                case GameEnum.CardBoardMode.Select:
                    while (GlobalBattleInfo.SelectBoardCardIds.Count < Mathf.Min(CardIds.Count, num) && !GlobalBattleInfo.IsFinishSelectBoardCard)
                    {
                    }
                    break;

                case GameEnum.CardBoardMode.ChangeCard:
                    while (Info.GlobalBattleInfo.ExChangeableCardNum != 0 && !Info.GlobalBattleInfo.IsSelectCardOver)
                    {
                        if (Info.GlobalBattleInfo.SelectBoardCardIds.Count > 0)
                        {
                            await CardCommand.ExchangeCard();
                            Info.GlobalBattleInfo.ExChangeableCardNum--;
                            Info.GlobalBattleInfo.SelectBoardCardIds.Clear();
                            UiCommand.SetCardBoardTitle("剩余抽卡次数为" + Info.GlobalBattleInfo.ExChangeableCardNum);
                            //Debug.Log("选择了卡牌" + Info.GlobalBattleInfo.SelectBoardCardIds[0]);
                            //Debug.Log("剩余抽卡次数为" + Info.GlobalBattleInfo.ChangeableCardNum);
                        }
                    }
                    break;

                case GameEnum.CardBoardMode.ShowOnly:
                    break;

                default:
                    break;
                }
            });

            Debug.Log("关闭");
            UiCommand.SetCardBoardHide();
            GlobalBattleInfo.IsWaitForSelectBoardCard = false;
        }
Ejemplo n.º 2
0
 public static void SetCardBoardMode(GameEnum.CardBoardMode CardBoardMode) => Info.GlobalBattleInfo.CardBoardMode = CardBoardMode;