Exemple #1
0
    /// <summary>
    /// 隐藏一些没有数量限额的卡牌
    /// </summary>
    private void HideNoLimitCards()
    {
        List <int> removeCards = new List <int>();

        foreach (KeyValuePair <int, CardBase> kv in AllShownCards)
        {
            if (kv.Value.CardInfo.BaseInfo.LimitNum == 0)
            {
                removeCards.Add(kv.Key);
            }
        }

        foreach (int cardID in removeCards)
        {
            AllCardContainers[cardID].gameObject.SetActive(false);
            AllShownCards.Remove(cardID);
        }
    }
Exemple #2
0
    private void HideHigherLevelNumCardsForStoryMode()
    {
        if (SelectBuildManager.Instance.CurrentGameMode == SelectBuildManager.GameMode.Single)
        {
            List <int> removeCards = new List <int>();
            foreach (KeyValuePair <int, CardBase> kv in AllShownCards)
            {
                //if (kv.Value.CardInfo.BaseInfo.CardRareLevel > StoryManager.Instance.Conquered_LevelNum + 1)
                //{
                //    removeCards.Add(kv.Key);
                //}
            }

            foreach (int cardID in removeCards)
            {
                AllCardContainers[cardID].gameObject.SetActive(false);
                AllShownCards.Remove(cardID);
            }
        }
    }
Exemple #3
0
    public void SetCardLimit(SortedDictionary <int, int> cardLimits)
    {
        foreach (KeyValuePair <int, int> kv in cardLimits)
        {
            int CardID         = kv.Key;
            int CardLimitCount = kv.Value;

            if (AllCards.ContainsKey(CardID))
            {
                CardBase cb = AllCards[CardID];
                cb.ChangeCardSelectLimit(CardLimitCount);

                if (!AllShownCards.ContainsKey(CardID))
                {
                    if (CardLimitCount > 0)
                    {
                        AllShownCards.Add(CardID, cb);
                        AllCardContainers[CardID].gameObject.SetActive(true);
                    }
                    else
                    {
                        AllCardContainers[CardID].gameObject.SetActive(false);
                    }
                }
                else
                {
                    if (CardLimitCount == 0)
                    {
                        AllCardContainers[CardID].gameObject.SetActive(false);
                        AllShownCards.Remove(CardID);
                    }
                }
            }
        }

        HideHigherLevelNumCardsForStoryMode();
    }