I’ve been trying things out lately and ran into one ‘issue’. I made an inventory system. Everytime you right click with mouse on the inventory slot that contains an item you get a menu with two options (Use, Drop).
Drop method is simple, but I’m not sure with Use, because I might be selecting any type of item (e.g. Weapon, Health kit, keycard) and these all items have different use methods (e.g. for Weapon I would like to equip the selected weapon, for health item I would like to heal, for keycard use it on a door if able).
Whenever I select the item and display the menu I send the Item scriptable object with all the item data. So it’s no telling what item it is. Well I could create an enum and specify the type and then do a switch and according to the type of item do something. But that could become really messy real quick.
What would be the decent / better approach in making this (Use functionality)?