Unity component that keeps the editor scene view active when entering play mode.
✓ Published0🌍 Public
MMcNull
Last edited Aug 7, 2018
Created on Aug 7, 2018
This example demonstrates a small Unity editor utility component that refocuses the Scene view when entering Play Mode. The `KeepSceneViewActive` MonoBehaviour, placed on any game object, checks a public boolean `KeepActive` and, during `Start`, calls `UnityEditor.EditorWindow.FocusWindowIfItsOpen` with `UnityEditor.SceneView` as the target type. It relies on the `UNITY_EDITOR` preprocessor directive to ensure the editor-only code is compiled only in the Unity Editor. The behavior is immediate and automatic, requiring no user interaction beyond attaching the component.
AI-generated description