Hello everyone,
I have a UI element (I’ll call it panel) that shows related stats to an item. I have a method that consumes an integer which is the item ID, and displays the stats.
public void PopulatePanelModulesUI(int ID)
Now this time I will be instantiating a UI element which displays the image of a module, for all modules that the player currently has active. What I want to do is, when the player puts their cursor above the UI image of that module I want to populate the panel by calling the method above.
Normally I would drag my game object to the left that contains the PanelScript. From the PanelScript I would choose the PopulatePanelModulesUI and in here even enter the ID that I want to pass through.
How can I achieve this via the script since I will be instantiating the module images as the player picks up modules? I have seen a lot of forum posts about how to create Unity Events but I don’t understand how do you choose ALL the parameters I described above? I wish I could just find the game object, then access the script and then say “From PanelScript, call PopulatePanelModulesUI and pass the the ID X”
Has anyone done something like this before? Any help is appreciated