SceneViewExtensions.cs 505 B

12345678910111213141516171819
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. using UnityEditor;
  4. namespace O3DWB
  5. {
  6. public static class SceneViewExtensions
  7. {
  8. #region Utilities
  9. public static bool IsSceneViewWindowFocused()
  10. {
  11. // Note: The focused window can be null if we just switched from play mode to edit mode.
  12. if (EditorWindow.focusedWindow == null) return false;
  13. return EditorWindow.focusedWindow.GetType() == typeof(SceneView);
  14. }
  15. #endregion
  16. }
  17. }
  18. #endif