- Home /
Event system or UI Button ?
Hi, i have an equip system where a tooltip appears when clicking an item in the inventory asking to equip(button) and if its in the equipment slot the tooltip asks to remove(button) or swap(button). My question is : Is it better to go with a UI button in the editor to equip or is it better to use an event system in my itemtooltip script?
Knowing that : My equip method has 2 arguments = > Equiplocation and EquipmentItem My Remove has 1 arguments=> Equiplocation
I tried both ways. Problem#1 is with the event system, since my tooltip is instantiated when clicking the item, my events don't subscribe at start or awake...it gives me a null reference.
Problem #2 is that with the UI button, it can only take 1 argument in the editor...I can't use 2 arguments for my equip button....
Can someone guide me to which way is the optimal one and/or a tutorial that explains why use one method instead of the other? Thanks