protected void OnSelectCharacterSkill(UICharacterSkill ui)
 {
     if (uiSkillDialog != null)
     {
         uiSkillDialog.selectionManager = SelectionManager;
         uiSkillDialog.Setup(ui.Data, character, ui.indexOfData);
         uiSkillDialog.Show();
     }
 }
Beispiel #2
0
    protected override void UpdateData()
    {
        var characterHotkey = Data;
        var skill           = characterHotkey.GetSkill();
        var item            = characterHotkey.GetItem();

        var owningCharacter = BasePlayerCharacterController.OwningCharacter;

        if (uiCharacterSkill != null)
        {
            if (skill == null)
            {
                uiCharacterSkill.Hide();
            }
            else
            {
                var index = owningCharacter.IndexOfSkill(characterHotkey.dataId);
                if (index >= 0 && index < owningCharacter.skills.Count)
                {
                    var characterSkill = owningCharacter.skills[index];
                    uiCharacterSkill.Setup(new CharacterSkillLevelTuple(characterSkill, characterSkill.level), owningCharacter, index);
                    uiCharacterSkill.Show();
                }
                else
                {
                    uiCharacterSkill.Hide();
                }
            }
        }

        if (uiCharacterItem != null)
        {
            if (item == null)
            {
                uiCharacterItem.Hide();
            }
            else
            {
                var index = owningCharacter.IndexOfNonEquipItem(characterHotkey.dataId);
                if (index >= 0 && index < owningCharacter.nonEquipItems.Count)
                {
                    var characterItem = owningCharacter.nonEquipItems[index];
                    uiCharacterItem.Setup(new CharacterItemLevelTuple(characterItem, characterItem.level), owningCharacter, index, string.Empty);
                    uiCharacterItem.Show();
                }
                else
                {
                    uiCharacterItem.Hide();
                }
            }
        }
    }
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (instance != null && !instance.gameObject.activeSelf)
     {
         if (instance is UICharacterItem && uiCharacterItem.Data.characterItem?.GetItem() != null)
         {
             UICharacterItem ui = instance as UICharacterItem;
             ui.Setup(uiCharacterItem.Data, uiCharacterItem.Character, uiCharacterItem.IndexOfData);
             CalculateTooltipPosition();
         }
         if (instance is UICharacterSkill && uiCharacterSkill.Data.characterSkill?.GetSkill() != null)
         {
             UICharacterSkill ui = instance as UICharacterSkill;
             ui.Setup(uiCharacterSkill.Data, uiCharacterSkill.Character, uiCharacterSkill.IndexOfData);
             CalculateTooltipPosition();
         }
     }
 }