Sometimes the Scene view is more useful than the Game view, but when I press the “Play” button, Unity switch automatically to the Game tab.
The only solution I’ve found is to use a Layout where I see the scene AND the game view together… Any way to to tell Unity I don’t want to see the Game view when I press play ?
you are correct, when you hit play it automatically goes to the game tab. it would be nice if they had a option for it to automatically only go on that certain tab or go to the desired window when running
I have done mine like this http://i.imgur.com/Ecw2h3B.png. Both the scene view and Game view have exactly 16:9 aspect ratio on my 1920x1080 screen so i can see exactly what i will see in the final game, and the scene view is quite massive.
I ran across this thread when looking for a solution a long time ago, I apologize for re-awaking this necro thread, but I took the information here and came up with a helpful way to use this that’s easy to remove later.
Just create a new C# script called “DebugManager” (or your own name, season to taste) with the following code:
#if UNITY_EDITOR
using UnityEngine;
public class DebugManager : MonoBehaviour
{
public bool useSceneView = false;
// Start is called before the first frame update
private void Awake()
{
if (useSceneView)
{
UnityEditor.SceneView.FocusWindowIfItsOpen(typeof(UnityEditor.SceneView));
}
}
}
#endif
Create an empty game object in your scene and attach this script to it so that it executes on the awake. Toggle the “Use Scene View” checkbox to start up in game mode or scene mode if you want to switch the two. If you forget to remove the game object, no harm, because it does have the #ifdef, but you can remove the object later without tainting any of your existing code.
As the community had a great answer for this, thought I’d share.
Thank you for your original answer! --I was inspired to make it an optional thing because there are times I needed to change my perspective in scene view, but the game mode was handling mouse input for other purposes. I needed to be able to do both when debugging. Cheers!
It’s nice, but will it work when I pause and unpause the play mode? Start and/or awake won’t be called in that case. I guess your solution could be expanded using EditorApplication.pauseStateChanged
I’d be glad to test this, but unfortunately Microsoft’s latest update this morning has rendered my Unity development workstation nonbootable, so I’ll have to get back to you after I get that little mess resolved. {sigh} Thanks, Microsoft…for nothing!
Hey, this is awesome. I’m addicted to shading and lighting so keeping me away from that until the end of the project is a good idea… this script combined with WIREFRAME view mode for the SceneView is totally 90s LightWave chic!
Combined solutions and suggestions from previous posts, got the following script. In general, it tries to keep the current Scene or Game window active, preventing switching between them. Handles pause in play mode. Layout Scene and Game windows as adjacent tabs for the script to work properly. Works better when using Enter Play Mode Options enabled with Reload Domain disabled. If not, then the forceFocusSceneOnPlay value is used. Change TRUE to FALSE on the first line to disable script.