Unity: Events vs Interfaces

“Events are evil!” is a common opinion among Unity developers. What are the reasons behind this statement and are interfaces an alternative to events? Example implementation at the bottom.     Problems A common source for event bugs are timing issues. For an event to work correctly you have to subscribe before it’s triggered and … Read more

Unity: Comment Component

Problem Do you ever think “The GameObject setup is so weird, it should be documented” but then don’t do it? Or are you forced to insert components in strange places because Unity just can’t do it any other way? Keyword: Unity’s UI rendering order is influenced by the hierarchy.   Most of the time it … Read more

Unity: Screen Space Gizmos

Unity’s default gizmos are essential for visual debugging but can only be drawn in world space. This restriction can be rather annoying if you try to debug custom UI or viewport-based camera movement. A simple line at a specific pixel coordinate would solve the problem most of the time. There are two solutions to this … Read more

Unity: UI Workflow Improvement

  If you build a game in Unity you will need a few UI screens to guide your player. The number of canvases will increase with the complexity and size of your project.   The canvases and the UI graphics will start to clutter your scene view because canvases are not moveable. This leads to … Read more