I have a UI system, which lets you set up a character.
From this UI system it is possible to open character selection screen in the same scene. Upon selecting character, it informs the UI system using the Observer pattern, so that it can display that character’s information.
The issue is that I have multiple different select screens, such as character, items etc., so the UI system’s inheritance list bloats like this:
MyUiSystem : MonoBehaviour, ISelectCharacterObserver, ISelectItemObserver
While it works, it creates a lot of mess.
Character selection screen is used in multiple UI systems, so it cannot directly reference any of them and I would prefer not to.
Is there a nicer pattern for acting when an Item is selected?