public void ShowHiddenCard(int cardID) { CardBase cb = AllCards[cardID]; if (!AllShownCards.ContainsKey(cardID)) { AllShownCards.Add(cardID, cb); AllCardContainers[cardID].gameObject.SetActive(true); } }
public void UpdateCardUpgradeDegrade(bool isUpgrade, CardBase previewCard) { if (CurrentEditBuildButton == null) { NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("Notice_SelectBuildManagerPreviewUpgrade_PleaseCreateDeck"), 0f, 1f); return; } int currentCardID = previewCard.CardInfo.CardID; int changeCardID = isUpgrade ? previewCard.CardInfo.UpgradeInfo.UpgradeCardID : previewCard.CardInfo.UpgradeInfo.DegradeCardID; CardInfo_Base changeCardInfo = global::AllCards.GetCard(changeCardID); if (previewCard.CardInfo.BaseInfo.LimitNum == 0) { return; } if (CurrentEditBuildButton.BuildInfo.M_BuildCards.GetCardLimitDict()[currentCardID] > 0) { if ((CurrentGamePlaySettings.DefaultMaxCoin - CurrentEditBuildButton.BuildInfo.BuildConsumeCoin) + (previewCard.CardInfo.BaseInfo.Coin - changeCardInfo.BaseInfo.Coin) < 0) { NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("Notice_SelectBuildManagerPreviewUpgrade_NotEnoughBudget"), 0f, 1f); return; } } CardBase changeCard = AllCards[changeCardID]; if (changeCard.CardInfo.BaseInfo.LimitNum == 0) { AllCardContainers[changeCardID].gameObject.SetActive(true); AllShownCards.Add(changeCardID, changeCard); } previewCard.ChangeCardSelectLimit(previewCard.CardInfo.BaseInfo.LimitNum - 1); changeCard.ChangeCardSelectLimit(changeCard.CardInfo.BaseInfo.LimitNum + 1); CurrentEditBuildButton.BuildInfo.M_BuildCards.CardSelectInfos[previewCard.CardInfo.CardID].CardSelectUpperLimit--; CurrentEditBuildButton.BuildInfo.M_BuildCards.CardSelectInfos[changeCardID].CardSelectUpperLimit++; if (GetSelectedCardCount(previewCard.CardInfo.CardID) > 0) { UnSelectCard(previewCard, SelectCardMethods.UpgradeDegrade); SelectCard(changeCard, SelectCardMethods.UpgradeDegrade); RefreshCoinLifeEnergy(); } AudioManager.Instance.SoundPlay("sfx/OnMoneyChange"); AudioManager.Instance.SoundPlay("sfx/ShowCardDetail"); HideNoLimitCards(); }
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(); }