public void addCard(int index, Cardmaker mkr, deckType type, int count = 1) { Dictionary <int, CardCountUI> deckList; GameObject deckTarget; if (type == deckType.main) { deckList = currentMainDeckList; deckTarget = mainDeckList; } else //if (type == deckType.structure) { deckList = currentStrcDeckList; deckTarget = strcDeckList; } if (deckList.ContainsKey(index)) { if (deckList[index]) { //Debug.Log("existing " + count); deckList[index].incrementCount(count); return; } } //Debug.Log("new " + count); GameObject cc = Instantiate(cardCountPre, deckTarget.transform); CardCountUI ccUI = cc.GetComponent <CardCountUI>(); ccUI.setCardmaker(mkr, index, type, this); ccUI.incrementCount(count); deckList[index] = ccUI; //Debug.Log(deckList.Count); //Debug.Log(deckList[index].count); }
public void swapMode(deckType newMode) { modeToggle(false); mode = newMode; modeToggle(true); }