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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.