Tinkering in Unity, I have a part of my GUI that will render information (e.g. enemy stats) from one of several different class types representing different things in the game. All of the different classes have a method for creating an information object that contains the desired information (e.g. enemyInfoObject), which have a DrawInfo() method that draws the info depending on the gameObject.
In my information-rendering script I would like to be able to assign any one of the different information objects to a single variable (i.e. the currently selected enemy, NPC, etc.) and be able to call the DrawInfo() method. Is there a clean, simple, and/or better way to do this?
I can elaborate if needed.