Reply To: EventSystem and Custom Events purpose?

Home Forums Books Unity 3D UI Essentials EventSystem and Custom Events purpose? Reply To: EventSystem and Custom Events purpose?

#6512

Thomas

Thanks Simon,

Ok, so my situation is (I think) fairly simple.

I have a ShopItem and a ShopItemList (sorta like ListViewItem and ListView in winforms).

I have a snazzy ShopItem that I want to raise some events on, the most important is when it is selected.  It already handles the click handler, updates itself to display appropriately, but the ShopItemList needs to know that it was selected BECAUSE if this is a single item select type list, then it needs to remove the selection from the previously selected item (if there was one) and now know this item was selected.

So I think there should be an event like ShopItemSelected and any other object that cares about those events can react to it.  For instance, beyond the list container itself, if I have a detailed text description of said shop item it would care to know the selected one changed.  Perhaps a button becomes active now that an item is selected.  So I really do want a loosely coupled publish/subscribe model which I thought the EventSystem would give me but now I’m not so sure.

Thanks.