I have a Canvas
that has multiple UI Panels
in it for an inventory, crafting, etc. To open these panels I currently have a monobehaviour
class on the Canvas
with methods like OpenInventory()
, etc.
For every item within the inventory I use ScriptableObjects
. However, some items open the crafting panel when right clicking, I created a class that extends the Item
class and added a method to it that gets added to the inventory slot and gets called when right clicking that item.
Because the monobehaviour
on the Canvas
is an instance, I can't access it from a ScriptableObject
.
Long story short, is there a way to open a UI panel from a ScriptableObject? If not, what would be the best way to fix this issue?