Пример #1
0
    private void GenerateCardListRandomly()
    {

        int tmpNum = this.MarionetteCardNumber;
        while (tmpNum > 0)
        {
            int randomIndex = UnityEngine.Random.Range(0, Utilities.MARIONETTE_CARD_NUM);
            MarionetteCard card = Utilities.MarionetteCardList[randomIndex];
            if (!card.IsSelected)
            {
                card.IsSelected = true;
                MarionetteCardList.Add(card);
                tmpNum--;
            }
        }

        tmpNum = this.DrawingCardNumber;
        while (tmpNum > 0)
        {
            int randomIndex = UnityEngine.Random.Range(0, Utilities.DRAWING_CARD_NUM);
            DrawingCard card = Utilities.DrawingCardList[randomIndex];
            if (!card.IsSelected)
            {
                card.IsSelected = true;
                DrawingCardList.Add(card);  
                tmpNum--;
            }
        }

        tmpNum = this.GoodCardNumber;
        while (tmpNum > 0)
        {
            int randomIndex = UnityEngine.Random.Range(0, Utilities.GOOD_CARD_NUM);
            GoodCard card = Utilities.GoodCardList[randomIndex];
            if (!card.IsSelected)
            {
                card.IsSelected = true;
                GoodCardList.Add(card);
                tmpNum--;
            }
        }
    }
Пример #2
0
 public void ClearAll()
 {
     MarionetteCardList.Clear();
     DrawingCardList.Clear();
     GoodCardList.Clear();
 }