- Home /
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.
Could you give more information on what you want to do? Depending on what and how you want to achieve it, the response might be different.
With this much info, I can tell you to use OnDrawGizmos()
and to draw wireframe cubes at the correct position and size. Some example code:
void OnDrawGizmosSelected () {
Gizmos.color = Color.white;
Gizmos.DrawWireCube(transform.position, new Vector3(1, 1, 1));
}
Answer by morganlining · May 18, 2018 at 05:51 AM
I have found the answer and code example. link text
Answer by NoDumbQuestion · May 17, 2018 at 09:12 AM
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
Oh, I didn't know about Handles
, only Gizmos
! Thanks for this info!
Thanks for your answer. But It only can be seen in the scene view if using Gizmo or Handles. I want to draw those girds in the game view. It there a way or tool to implement it?
Custom sprite that only show as 1 line. $$anonymous$$ake an game object with it. 12 lines to make a cube.
Then make a custom function that resize that cube gameobject based on size.
Literally just a 1,1,1 cube with only outline
Your answer
![](https://koobas.hobune.stream/wayback/20220612162839im_/https://answers.unity.com/themes/thub/images/avi.jpg)