AutoHideUI Class

Summary

[Editor-Only] Automatically hides the UI layer inside the Editor so it doesn't get in the way of 3D objects in scene view.

When any object is selected that is on the UI layer, the layer will be shown and the camera changed to 2D orthographic and zoomed to the current selection.

When any object on another layer is selected, the UI layer will be hidden and the camera changed back to the previous state.
Assembly
Kybernetik.InspectorGadgets.Editor.dll
Namespace
InspectorGadgets.Editor
Base Types
  • ScriptableObject
graph BT Type-->Base0["ScriptableObject"] Type["AutoHideUI"] class Type type-node

Syntax

[InitializeOnLoad]
public sealed class AutoHideUI : ScriptableObject

Remarks

The only reason this class inherits from UnityEngine.ScriptableObject is so that UnityEditor.MonoScript.FromScriptableObject(UnityEngine.ScriptableObject) can be used to find its file path to determine whether it is in the process of being deleted.

Attributes

Type Description
InitializeOnLoadAttribute

Fields

Name Constant Value Summary
FocusOnSelection
If true, selecting a UI object will focus the scene camera on that object. Otherwise it will focus on the root UnityEngine.Canvas of that object.
static
IsEnabled
Is this system currently operating?
static
IsShowingUI
Is the UI layer currently visible?
static
OnEnabledChanged
Is this system currently operating?
static
Previous2dMode
Was the scene camera in 2D mode before the UI was focussed?
static
PreviousOrthographicMode
Was the scene camera in Orthographic mode before the UI was focussed?
static
PreviousPivot
The pivot point of the scene camera from before the UI was focussed.
static
PreviousRotation
The rotation of the scene camera from before the UI was focussed.
static
PreviousSize
The orthographic size of the scene camera from before the UI was focussed.
static
RequireCanvas
Should this system only activate for objects with a UnityEngine.Canvas on a parent?
static
UiLayer 5
The inbuilt layer named "UI".
static
UILayerMask
The bit mask of layers that are considered to contain UI objects.
static
ZoomMultiplier
Higher values cause the framed area to be larger on screen.
static