Is there anyway to check when an item is equipped to a equipment slot?

I am currently connecting the framework with my 2d platform code and need to to see when a item has been added or removed to a equipment slot. Is there an event that is rigger or a delegate I could use?
  • As with many such things in ORK, there's an event handler you can register to get updates - for equipment changes, you'll need a function like this:

    public void EquipChanged(Combatant combatant)
    And to register (or unregister) for updates:
    combatant.Equipment.Changed += EquipChanged; // register
    combatant.Equipment.Changed -= EquipChanged; // register

    combatant is the combatant you want to get changes for.

    The function will be called each time an equipment changed.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you very much. This worked exactly as I wanted.
Sign In or Register to comment.