Advanced Topics – Gizmos, Automated Testing, and More
This chapter will cover three sets of advanced recipes:
- Gizmos
- Automated testing
- An introduction to Unity Python
Gizmos facilitate Unity Editor customization. Gizmos are visual aids for game designers that are provided in the Scene panel. They can be useful as setup aids (to help us know what we are doing) or for debugging (understanding why objects aren’t behaving as expected).
Gizmos are not drawn through Editor Scripts, but as part of the MonoBehaviour
class, so they only work for GameObjects in the current scene. Gizmo drawing is usually performed with two methods:
OnDrawGizmos()
: This is executed at every frame or Editor window repaint, for every GameObject in the Hierarchy panel.OnDrawGizmosSelect()
: This is executed at every frame, for just the GameObject(s) that is currently selected in the Hierarchy panel.
Gizmo graphical drawing makes it simple...