if (Input.GetMouseButtonDown (0)) {
if (ORK.GUI.Tooltip.TooltipContent != null) {
string clickedName = ORK.GUI.Tooltip.TooltipContent.GetContent ().text;
EquipmentPart equipmentPart = null;
for (int i = 0; i < ORK.EquipmentParts.Count; i++) {
if (ORK.EquipmentParts.GetName (i) == clickedName) {
equipmentPart = ORK.EquipmentParts.Get (i);
}
}
if (equipmentPart != null) {
Debug.Log (player.Equipment [equipmentPart.ID].Equipped);
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
For an empty slot, the EquipmentPart setting itself is used, i.e.:
EquipmentPart part = ORK.GUI.Tooltip.TooltipContent as EquipmentPart;
if(part != null)
{
// it's an equipment part
}
will already give you the equipment part.
If something is equipped on it, it'll be the EquipShortcut of the equipment and you'd have to search the menu user's equipment for the correct part:
EquipShortcut equip = ORK.GUI.Tooltip.TooltipContent as EquipShortcut;
if(equip != null)
{
Combatant user = ORK.MenuScreens.Get(menuID).Combatant;
if(user != null)
{
for(int i=0; i<ORK.EquipmentParts.Count; i++)
{
if(user.Equipment[i].Equipment == equip)
{
// that's the equipment part
}
}
}
}
menuID is the ID/index of your menu screen.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
So, it could be a setting, one of the shortcuts, a combatant, a scene object component, etc.
If you're looking for something, just try checking it like that, and if it's not null, you're already good to go :)
And if you just need some content information (e.g. name, description), you can directly access it via the interface.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!