To create a design-time snap-to-grid drawn by a Gizmo in the Scene window, follow these steps:
- Create a new Unity 3D project.
- In the Scene window, turn off the Skybox view (or simply toggle off all the visual settings) so that you have a plain background for your grid:

Figure 13.4 – Turning off the Skybox view in the Scene window
- Updating the display and the child objects will be performed by a script class called GridGizmo. Create a new C# script class called GridGizmo that contains the following code:
using UnityEngine;
public class GridGizmo : MonoBehaviour {
public int grid = 2;
public void SetGrid(int grid) {
this.grid = grid;
SnapAllChildren();
}
public Color gridColor = Color.red;
public int numLines = 6;
public int lineLength = 50;
private void SnapAllChildren() {
foreach (Transform child...