protected void OnSelectCharacterSummon(UICharacterSummon ui) { if (uiSummonDialog != null) { uiSummonDialog.selectionManager = SelectionManager; uiSummonDialog.Setup(ui.Data, character, ui.indexOfData); uiSummonDialog.Show(); } }
public void UpdateData(ICharacterData character) { this.character = character; uint selectedSummonObjectId = CacheSummonSelectionManager.SelectedUI != null ? CacheSummonSelectionManager.SelectedUI.CharacterSummon.objectId : 0; CacheSummonSelectionManager.DeselectSelectedUI(); CacheSummonSelectionManager.Clear(); Dictionary <int, UICharacterSummon> stackingSkillSummons = new Dictionary <int, UICharacterSummon>(); IList <CharacterSummon> summons = character.Summons; CacheSummonList.Generate(summons, (index, characterSummon, ui) => { if (characterSummon.type == SummonType.Skill && stackingSkillSummons.ContainsKey(characterSummon.dataId)) { stackingSkillSummons[characterSummon.dataId].AddStackingEntry(characterSummon); ui.gameObject.SetActive(false); } else { UICharacterSummon uiCharacterSummon = ui.GetComponent <UICharacterSummon>(); uiCharacterSummon.Setup(characterSummon, character, index); uiCharacterSummon.Show(); switch (characterSummon.type) { case SummonType.Skill: stackingSkillSummons.Add(characterSummon.dataId, uiCharacterSummon); break; case SummonType.Pet: ui.transform.SetAsFirstSibling(); break; } CacheSummonSelectionManager.Add(uiCharacterSummon); if (selectedSummonObjectId == characterSummon.objectId) { uiCharacterSummon.OnClickSelect(); } } }); }