Exemple #1
0
        //static int num = 0;
        public static async Task BattleStart()
        {
            await Task.Run(async() =>
            {
                //await Task.Delay(500);
                UiCommand.SetNoticeBoardTitle("对战开始");
                UiCommand.NoticeBoardShow();
                await Task.Delay(2000);
                UiCommand.NoticeBoardHide();

                CardDeck Deck = AllPlayerInfo.Player1Info.UseDeck;

                for (int i = 0; i < Deck.CardIds.Count; i++)
                {
                    //print("我方创造卡片");
                    Card NewCard = await CardCommand.CreatCard(Deck.CardIds[i]);
                    if (GlobalBattleInfo.IsPlayer1)
                    {
                        RowsInfo.GetDownCardList(RegionTypes.Deck).Add(NewCard);
                    }
                    else
                    {
                        RowsInfo.GetUpCardList(RegionTypes.Deck).Add(NewCard);
                    }
                    //NewCard.Init();
                }
                Deck = AllPlayerInfo.Player2Info.UseDeck;
                for (int i = 0; i < Deck.CardIds.Count; i++)
                {
                    //print("敌方创造卡片");
                    Card NewCard = await CardCommand.CreatCard(Deck.CardIds[i]);
                    if (GlobalBattleInfo.IsPlayer1)
                    {
                        RowsInfo.GetUpCardList(RegionTypes.Deck).Add(NewCard);
                    }
                    else
                    {
                        RowsInfo.GetDownCardList(RegionTypes.Deck).Add(NewCard);
                    }
                }
                await Task.Delay(2000);
            });

            //print("结束对战准备");
        }
Exemple #2
0
        // Update is called once per frame
        void Update()
        {
            if (Input.GetMouseButtonDown(4))
            {
                print("yaya" + Command.AiCommand.GetRandom(0, 10));
                GlobalBattleInfo.TargetCard = RowsInfo.GetDownCardList(RegionTypes.Hand)[0];
                Command.CardCommand.WashCard();

                //RowsInfo.GetRegionCardList(RegionName_Battle.My_Water).Add(NewCard);
                //GameObject NewCard = Instantiate(CardLibrary.Instance.Card_Model);
                //print(NewCard.name);
            }
            if (Input.GetMouseButtonDown(3))
            {
                //CardCommand.DrawCard();

                //Card b = a.ThisRowCard[0];
                //a.ThisRowCard.Remove(b);
                //Destroy(b.gameObject);
            }
        }