예제 #1
0
        public void UpdateData(ICharacterData character)
        {
            this.character = character;
            string selectedBuffKey = CacheBuffSelectionManager.SelectedUI != null?CacheBuffSelectionManager.SelectedUI.CharacterBuff.GetKey() : string.Empty;

            CacheBuffSelectionManager.DeselectSelectedUI();
            CacheBuffSelectionManager.Clear();

            if (character == null)
            {
                CacheBuffList.HideAll();
                return;
            }

            IList <CharacterBuff> buffs = character.Buffs;

            CacheBuffList.Generate(buffs, (index, characterBuff, ui) =>
            {
                UICharacterBuff uiCharacterBuff = ui.GetComponent <UICharacterBuff>();
                uiCharacterBuff.Setup(characterBuff, character, index);
                uiCharacterBuff.Show();
                CacheBuffSelectionManager.Add(uiCharacterBuff);
                if (selectedBuffKey.Equals(characterBuff.GetKey()))
                {
                    uiCharacterBuff.OnClickSelect();
                }
            });
        }
예제 #2
0
 protected void OnDeselectCharacterBuff(UICharacterBuff ui)
 {
     if (uiBuffDialog != null)
     {
         uiBuffDialog.Hide();
     }
 }
예제 #3
0
 protected void OnDeselectCharacterBuff(UICharacterBuff ui)
 {
     if (uiBuffDialog != null)
     {
         uiBuffDialog.onHide.RemoveListener(OnBuffDialogHide);
         uiBuffDialog.Hide();
         uiBuffDialog.onHide.AddListener(OnBuffDialogHide);
     }
 }
예제 #4
0
 protected void OnSelectCharacterBuff(UICharacterBuff ui)
 {
     if (uiBuffDialog != null)
     {
         uiBuffDialog.selectionManager = CacheBuffSelectionManager;
         uiBuffDialog.Setup(ui.Data, character, ui.IndexOfData);
         uiBuffDialog.Show();
     }
 }