How to fill the space with grid?

Just like following picture, how to draw the white lines? I need to show it in the game view, not scene view.

I have found the answer and code example.
link text

Those are can draw by using Gizmo or Handles.

Those in your image are Handles Cube

You have to write a custom editor window or custom editor for script to draw something like that