Practical way to switch from hierarchy to project view in IDE

not very practical to move from hierarchy to project view. Visual studio has a button for this, but Unity misses this great feature. Here is the VS version. Called “Sync with Active Document”.

In Visual Studio 2015 and 2017 you can press Ctrl + [ and then s

Uhm, so you mean this:


It’s just two clicks instead of one. Keep in mind that you can now have several scenes open at the same time. So a button at the hierarchy window wouldn’t make much sense.

Though if you want you can create an editor script that listens for a keyboard shortcut and simply selects the scene that is currently open.

I just quickly wrote this editor script:

using UnityEditor;
using UnityEngine.SceneManagement;
using UnityEngine;

public class SelectEditorSceneAsset : ScriptableObject
    [MenuItem("Tools/OpenSceneAsset %&s")]
    static void SelectSceneAsset()
        var scene = SceneManager.GetActiveScene();
        if (!scene.IsValid() || string.IsNullOrEmpty(scene.path))
            for (int i = 0; i < SceneManager.sceneCount; i++)
                scene = SceneManager.GetSceneAt(i);
                if (scene.IsValid() && !string.IsNullOrEmpty(scene.path))
                    scene = new Scene();
        if (!scene.IsValid())
        var sceneAsset = AssetDatabase.LoadAssetAtPath< SceneAsset >(scene.path);
        if (sceneAsset == null)
        Selection.activeObject = sceneAsset;

When you have that script inside a folder named “editor” you can simply use the shortcut “CTRL + ALT + S” to select the scene asset that is currently open in the hierarchy. It tries to select the active scene first. If the active scene hasn’t been saved yet, it simply iterates through all active scenes and picks the first that has an asset path.

Just updated the script after i realised that “Scene” is not a class but a struct, so a null check was pointless ^^. Changed to an IsValid check.