Don't forget to subscribe to the newsletter in order to never miss anything.
Dialogue Box with Sprite Slicing
You can create a responsive Dialogue Box by modifying its “sprite slicing” settings.
(P.s. the text size is set to “Auto Size” and its anchor to “fill”).
Read more about Sprite Slicing.
Script Changes while Playing
You can set when to recompile your script changes (while playing) by going to Preferences->General.
You can use OnDrawGizmosSelected() to see only your selected GameObjects’ debug.
Auto Statements in Visual Studio
You can auto complete statements in Visual Studio by pressing Tab twice.
Second Parameter in Debug.Log
You can use the second parameter in Debug.Log() to select your object from the console’s message.
You can use String Interpolation to faster write strings with variables.
You can use Debug.Break() to pause the Editor via script.
Tips about starting learning game dev
I’ve noticed that a lot of people I’ve talked to want to learn about game dev and Unity but don’t know where to start, which stops them completely. Here’s a thread with some of my (humble) learning game dev advices!
You can read my gamedev tips here.
Multi-line Editing (Visual Studio)
You can edit multiple lines in Visual Studio instead of copying and pasting each time.
It also works in VSCode and others, but the key shortcuts might be different.
You can lock layers in the Editor to manage which objects to pick.
Header, Tooltip and Space
You can use the “Header”, “Tooltip” and “Space” attributes to better organize fields in the Inspector.
You can use the “TextArea” attribute to edit a string in a flexible text area.
You can use extension methods to add functionalities to already existing classes, types, structs and more!
Platform Custom #defines
You can set your own “Platform Custom #defines” to quickly add or remove features from your game’s build.
Read more about Platform dependant compilation.
Multiply Inspector’s editing speed
You can multiply the Inspector’s editing speed by pressing SHIFT (faster) or ALT (slower).
You can download all Unity’s built-in shaders (including all CGinc files) by visiting the Unity’s Archive download page.
You can use the ‘MinMax’ attribute I wrote to better edit “random Vector2s” in the Inspector.
You can use Animation Curves to create cool effects for your objects via code.
I have also written a tutorial about Lerp/Easing.
Un-dock the Preview window
You can un-dock the Preview window from the inspector and place it anywhere you want. (Right-Click on its top bar)
You can organize your Hierarchy by adding empty GameObjects as divisors.
I also suggest to set their tag to “EditorOnly”, so they’re not saved in the build.
Particle System Playback time
You can control the Particle’s playback time in the Editor to better edit effects.
You can use the “EditorOnly” tag to exclude a GameObject from the final build.
Assign a shader to a material upon creation
You can create a material after clicking on the desired shader to assign it automatically.
Insert array element in the Inspector
You can insert an array element in the Inspector by pressing the key shortcut “CTRL/CMD + D” (which stands for: “Duplicate”), without having to adjust the next elements manually.
Show the content of multiple folders
You can see the content of multiple folders by selecting them in the Project Window.
Customize Unity’s C# template
You can customize Unity’s C# template by changing the “81-C#” file found in the path: “
Remember to store a copy before modifying it!
You can find more info here.
P.S. when saving a copy of the original file, I recommend moving it into another folder or not naming it starting with “81-C#”.
Console Window Log Entries
You can adjust the number of lines shown for each Log in the Console Window, to read more (or less) text per entry.
You can make sure you entered the right value in the Inspector by helping you with the OnValidate function.
Read more about OnValidate
Set Editor Presets as Default
You can set Editor Presets as default and then apply them by pressing “Reset”.
Editor color in Play Mode
You can remind yourself that the Editor is in Play Mode by changing its “Playmode tint”.
Drag/select scenes in the build settings
You can drag multiple scenes in the build settings and enable/disable them at the same time (instead of one by one).
Fold the entire Hierarchy
You can fold the entire Hierarchy using the code linked below or by pressing ALT + left mouse click.
This way you’ll collapse all the GameObjects in the window with a simple click (mostly useful if you also add a keyboard shortcut).
Rich text in the console
You can use rich text in Unity’s console.
Read more about Rich Text.
Asset store search in project window
You can search through the Asset Store directly from your project window.
DisallowMultipleComponent & RequireComponent
Drag multiple items in the inspector
You can drag multiple items in an array by locking the Inspector.
You can use 20+ handy attributes made by dbrizov on GitHub, like a ReorderableList, a Slider or a ResizableTextArea.
GitHub repository here by dbryzov.
You can group variables in the Inspector using the Foldout attribute, made by dimmpixeye on GitHub.
GitHub repository here by PixeyeHQ.
You can assign icons for GameObjects and Scripts.
Read more about Assignign Icons.
Call methods from the Inspector by using the ContextMenu attribute.
Read more about ContextMenu.
Inspector Math Expressions
You can enter math expressions in the Inspector.
SerializeField & HideInInspector
Useful if you need to rename a variable without losing its serialized value.
Read more about FormerlySerializedAs attribute.
Organize your scripts in the “AddComponent” Menu in the Inspector by using the AddComponentMenu attribute.
Read more about AddComponent.
Call methods from the Main Menu and Inspector Context Menus. Be aware that it only works in the Editor, so you need to cut it if you want to release that code. (Add
#if UNITY_EDITOR and you’re good to go).
Read more about MenuItems.