In Unity3D, is it possible to focus the scene when I click on Play?

In Unity3D, when you click on a game, by default it switches to the full view of the “game”, which is great for previews, etc., but sometimes we just want to see our results in the “Scene” view, t need to worry about customization all lighting, materials, etc.

Now we know that we can just create a new layout that simultaneously displays the “Game” and “Scene” tabs, and that we do this, we can continue to watch the “Scene” tab when we start. However, we just don’t want to see the “Game” tab. Love, just to hide it until we need it later.

Can this be done?

+6
source share
2 answers

The game scene cannot be closed during the game. But I found a small workaround: you can turn off the game’s presentation in a separate window, make it as small as possible and place it next to the play button as follows:

enter image description here

Now, when you press the play button, just click in the empty area left of the play button as soon as the game presentation becomes focus. This is faster than working with the mouse on tabs. On the other hand, if you are a keyboard addict like me, press CMD + P, CMD + on Mac or the equivalent on Windows.

+4
source

Place this component in any GameObject and set the KeepSceneViewActive field to true .

 using UnityEngine; using System.Collections; public class KeepSceneAlive : MonoBehaviour { public bool KeepSceneViewActive; void Start() { if (this.KeepSceneViewActive && Application.isEditor) { UnityEditor.SceneView.FocusWindowIfItsOpen(typeof(UnityEditor.SceneView)); } } } 
+6
source

Source: https://habr.com/ru/post/908751/


All Articles