public void ShowTooltip(AbilitySlotController slot) { if (toolTip.SetupTooltip(slot)) { if (toolTip.isHidden) { toolTip.ShowTooltip(); } } }
void UpdatePanelSlots() { int index = 0; foreach (Transform child in abilityPanel.transform) { AbilitySlotController slot = child.GetComponent <AbilitySlotController>(); if (index < activeBar.Count) { slot.ability = activeBar[index]; } else { slot.ability = null; } slot.UpdateInfo(); index++; } }
public bool SetupTooltip(AbilitySlotController slot) { Ability ability = slot.ability; if (ability == null) { return(false); } abiityNameText.text = ability.name; description.text = ability.description; range = ability.requiredPosition; for (int i = 0; i < requiredPositions.Length; i++) { if (range[i]) { requiredPositions[i].isOn = true; } else { requiredPositions[i].isOn = false; } } if (ability.canCastOnAllies) { curColour = allyColour; range = ability.alliedRange; } else { curColour = enemyColour; range = ability.attackRange; } for (int i = 0; i < targetPositions.Length; i++) { targetPositions[i].graphic.color = curColour; if (range[i]) { targetPositions[i].isOn = true; } else { targetPositions[i].isOn = false; } } //Change this once the ability/behaviour relation is reworked. string modifierText = ""; for (int i = 0; i < ability.attackRollModifiers.Length; i++) { if (ability.attackRollModifiers[i].isApplied) { if (!modifierText.Equals("")) { modifierText += ", "; } modifierText += ability.attackRollModifiers[i].modifierType.ToString(); } } abilityModifiers.text = modifierText; return(true); }