public void ActiveMainUI() { //덱 세팅 var deckDataDic = DeckManager.Instance.DeckDic; for (int i = 0; i < mainSlotUIArray.Length; i++) { DeckData deckData = null; if (deckDataDic.ContainsKey(i)) { deckData = deckDataDic[i]; } //데이터가 없다면 비어있는 덱 mainSlotUIArray[i].Init(i, deckData, ClickDeckSlot); } //사용중인 덱 선택 if (curSelectedMainSlot == null) { int index = DeckManager.Instance.CurDeckIndex; curSelectedMainSlot = mainSlotUIArray.ElementAtOrDefault(index); } curSelectedMainSlot?.ClickSlot(); //각 UI 루트 활성화/비활성화 mainRoot.SetActive(true); deckEditRoot.SetActive(false); SlotEditRoot.SetActive(false); deckEditNameInput.value = string.Empty; }
public void Start() { var deckDataDic = DeckManager.Instance.DeckDic; var deckKeyList = deckDataDic.Keys.ToList(); deckKeyList.Sort(); foreach (var key in deckKeyList) { if (!deckDataDic[key].IsCompleteDeck()) { continue; } var newDeckSlot = Instantiate(deckSlotPrefab, uiGrid.transform); newDeckSlot.Init(key, deckDataDic[key], ClickDeckSlot); newDeckSlot.gameObject.SetActive(true); deckSlotDic.Add(key, newDeckSlot); } int index = DeckManager.Instance.CurDeckIndex; if (deckSlotDic.ContainsKey(index)) { curSelectedMainSlot = deckSlotDic[index]; curSelectedMainSlot.ClickSlot(); } centerOnChild.onCenter += MoveToCurrentDeckPos; }
public void ClickDeckSlot(DeckSlotUI slot) { curSelectedMainSlot?.ActiveHighlight(false); curSelectedMainSlot = slot; curSelectedMainSlot?.ActiveHighlight(true); string infoText = "비어있음"; Dictionary <int, CharacterData> dataDic = null; if (curSelectedMainSlot.Data != null) { dataDic = curSelectedMainSlot.Data.DataDic; infoText = curSelectedMainSlot.Data.DeckSynergyText; } mainInfoLabel.text = infoText; for (int i = 0; i < mainInfoSlotUIArray.Length; i++) { CharacterData charData = null; string slotName = "없음"; if (dataDic != null && dataDic.ContainsKey(i)) { charData = dataDic[i]; slotName = charData.NAME; } mainInfoSlotUIArray[i].Init(i, charData, slotName, null); } }
public void ClickDeckSlot(DeckSlotUI deckSlot) { curSelectedMainSlot?.ActiveHighlight(false); curSelectedMainSlot = deckSlot; curSelectedMainSlot?.ActiveHighlight(true); int deckIndex = curSelectedMainSlot.Index; DeckManager.Instance.ChangeUseDeck(deckIndex); }