How to do it...

To create a Gizmo to show the selected object in the Scene panel, follow these steps:

  1. Create a new 3D project.
  2. For the Scene panel, turn off the Skybox view (or simply toggle off all the visual settings) so that you have a plain background for your grid work:

  1. The display, and updating the child objects, will be performed by a script class called GridGizmo. Create a new C# script class called GridGizmo which contains the following:
    using System.Collections;     using System.Collections.Generic;     using UnityEngine;      public class GridGizmo : MonoBehaviour {         [SerializeField]         public int grid = 2;  public void SetGrid(int grid) { ...

Get Unity 2018 Cookbook - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.