Unity (game engine) does not recognize Dictionary or Tuple members in its Editor Inspector. So a custom solution was implemented to address this basic limitation.
The Inspector window in the Unity game engine is used to view & edit accessible properties & settings of serializable data within a game project.
It is also useful for debugging control quantities when evaluating playable features and code in general.
With Patch Odyssey in particular, UI (user interface) is one of the foundational systems that makes or breaks gameplay (which makes it priority in production). Ensuring the user interface is responsive and effectively communicates other systems within the game like character dialogue or status effects is important enough to warrant proper testing through the Inspector.
The game prototype uses GameObject UI components for its HUD (heads-up display) and menu visuals, which means that these elements can be assigned at runtime using scripts or with the Inspector window. It would be straight-forward to simply create member fields representing each element for display —
— but as typical with software engineering problems, that approach faces a challenge with scale i.e. Elements are not grouped together meaningfully, members can not be added or removed for debugging during testing, e.t.c.
To solve this robustly, a 1-to-1 dynamic map is needed to structure the view simply. The layman way provides this but a little bit of custom extension with constructs like UnityEditor.CustomPropertyDrawer(…), UnityEditor.PropertyDrawer.OnGUI(UnityEngine.Rect, UnityEditor.SerializedProperty, UnityEngine.GUIContent), and [UnityEditor.SerializeField] allow the flexibility to represent the UI component tree as intended without clutter or headaches later in development.
This article will not go in depth for the time being, but feel free to contact us for a minimal implementation of how this works.
Working hand-in-hand with Unity’s systems rather than fighting against or being fully dependent on it is what will make this prototype project a well-oiled success in the long run despite confronted short-term stints.