Created
August 7, 2018 13:52
-
-
Save McNull/48a55a6bc405398db48fe0a99287790b to your computer and use it in GitHub Desktop.
Unity component that keeps the editor scene view active when entering play mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// Keeps the editor scene view active when entering play mode. | |
/// Place this component on any game object. | |
/// </summary> | |
public class KeepSceneViewActive : MonoBehaviour | |
{ | |
[Tooltip("Keep the editor scene view active")] | |
public bool KeepActive = true; | |
#if UNITY_EDITOR | |
void Start() | |
{ | |
if (this.KeepActive && Application.isEditor) | |
{ | |
UnityEditor.EditorWindow.FocusWindowIfItsOpen(typeof(UnityEditor.SceneView)); | |
} | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment