What are you looking for?
Hero background image
Last updated January 2020, 7 min. read
Tips for using JetBrains Rider as your code editor with Unity

What you will get from this page: Tips for editing the code of your Unity projects efficiently with JetBrains Rider. JetBrains Rider is a cross-platform C# script editor with many rich features for Unity developers. Grab this advice, and then get even more guidance in this Unite session by Matt Ellis from JetBrains. 

c sharp scripts search shortcut
Shift+Shift

Use the Shift+Shift shortcut to search for anything in your C# scripts, such as files, classes or symbols. You can type pretty much anything in the search field and Rider will start to present you with choices. You don’t even need to type full words; Rider will recognize initials as well.

Once inside a file, you can use the Navigate to Member action to quickly jump to a method, property or field. Just start typing to narrow down the choices.

Alt+Enter shortcut pop-up context menu
Alt+Enter

Alt+Enter gives you a pop-up context menu of actions you can perform at any particular point in your code, including fixing any issues Rider finds while analyzing your code. For example, if you hit Alt+Enter over the name of a class, you will get a list of actions that include fixing naming standards or making the class public.

Or if you have the wrong name for an Invoke method, Rider will warn you up-front and show you code completion suggestions. While you’re still in the Editor, Rider protects you from making changes that would break your code, which you wouldn’t otherwise see until runtime.

Alt+Enter also provides entry points into pretty much all the functionality in Rider. If you can’t remember the keyboard shortcut for something, you can hit Alt+Enter, start typing, and see a list of actions relevant to your input.

You can use the Refactor This function to refactor code, rewrite it, move it to a different file, and safely rename symbols, including all usages in other files.

You can also use Alt+Enter to generate event functions. You can do this anywhere inside a Unity-based class. You’ll get a list of all of the event functions you can create in that particular class.

Rider recognizes when you have an event function, serialized field, or MonoBehaviour class and will highlight it in the code. If you hover over an event function, for example, you’ll get a tooltip with a description of what that event function does. You can type “quick documentation” to get more information in a pop-up window or follow the link to go to the full documentation.

Fast navigation

The Navigate to the menu is useful for moving quickly around your Unity code, such as jumping to base or derived classes, as well as finding usages. It can even decompile Unity code on the fly and show you what’s going on inside Unity’s own APIs.

Rider debugger
Debugging

The Rider debugger shows extra data for Unity objects. For example, when looking at a Scene in the debugger, you see a list of root GameObjects, and each GameObject shows child GameObjects and attached components. ECS Entity objects also show component data.

Rider includes a code-focused profiler that looks at just your scripts; it doesn't look at any of the other things that are happening inside Unity itself. You can quickly search for types and methods and perform what-if analysis to see if it’s worth optimizing a method.

scheme switcher
Scheme switcher

You can use the scheme switcher to change the look and feel of the Rider window and choose a light or dark theme.

This feature is also really useful when you’re pair programming with somebody because you can update things like the keymap as well. If one programmer likes working with one set of keys, while the other one chooses another set, you can very quickly switch between them.

For more guidelines, see the Rider for Unity docs.

Did you like this content?