web analytics

Unity Tips and Tricks – Editor Part 1

Unity Tips and Tricks 

  1.  Use gameobject icon to visualize empty gameobjects .You can view this icon in scene editor plus game scene . To view in Game window click on Gizmos.

unity tips and tricks 1

           and you can even use a texture just by clicking on other…

  1.  Use SHIFT + F shortcut or double tap F  to lock an object in scene view
  1. Use Layers Popup to lock objects and control visibility : Ever had hard time selecting objects ? Put objects in different layers to control them.

unity tips and tricks 2

Now i have locked the Road Layer ,now i can easily select the small objects placed on the road wihout worring about road selection .

  1.  Use Alt + Click to completely expand or collapse the project hierarchy .

unity tips and tricks 3

See the difference b/w simple click and Alt +Click (Full expansion)

  1. Use [HideInInspector] to hide public variables  : You can even hide public variables in the inspector by using [HideInInspector]
public class TestScript : MonoBehaviour {
    public int hiddenVariable = 100;   // Is hidden in inspector being public
    public int visibleVariable = 0;    // Is Visible in inspector
  1. You can align your camera with your current scene view using Align With View option

unity tips and tricks 4

Set your view in scene view and  Select the Main Camera  from the Hierarchy and then select Align with View .

unity tips and tricks 5

Unity Tips and tricks
  1. You can copy and paste any gameobject component .

unity tips and tricks 6

  1. You can switch your inspector into the debug mode

When you will enable debug mode ,Inspector will ignore all custom editor and will display both public and private variables( still can’t edit private variables). You can switch to debug in any mode (i..e Editor or Play)

unity tips and tricks 8

     9 . Use [Range] to clamp your inspector variables

[Range (1,10)]
public float distance;

This is how you will see in inspector

unity tips and tricks 9

  10. Use Header and Space attributes to organise your inspector

In the below ,its very hard to identify each variable


After using Header and space


Unity Tips and Tricks

Check  Unity Tips and Tricks Part 2 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *