Skip to content

SceneView

Antoine Lelievre edited this page Feb 15, 2018 · 3 revisions

UnityEditor.SceneView

Description

This class contains all infos of the scene tab in the editor, it can be used to modify the scene camera properties, focus or search objects in an opened scene view.

Properties

m_SceneLighting

public bool m_SceneLighting;

Is the lighting enabled in the scene view, can be get and set.

lastFramingTime

public double lastFramingTime;

Time since the last frame select ('f' press). Uses EditorApplication.timeSinceStartup to get time.

m_AudioPlay

public bool m_AudioPlay;

Is audio enabled in scene view, can be get and set.

m_ValidateTrueMetals

public bool m_ValidateTrueMetals

in2DMode

public bool in2DMode { get; set; }

Is the scene camera in 2D mode, can be get and set.

rotation

public Quaternion rotation { get; set; }

Rotation of the scene camera, can be get and set.

pivot

public Vector3 pivot { get; set; }

Pivot used to rotate the scene camera in ortho mode / when option is hold.

camera

public Camera camera { get; }

Scene camera.

orthographic

public bool orthographic { get; set; }

Is the camera in orthographic mode, can be get and set.

cameraDistance

public float cameraDistance { get; }

lastSceneViewRotation

public Quaternion lastSceneViewRotation { get; set; }

last scene camera rotation when it's 2D mode was changed.

public SceneViewState sceneViewState { get; }

Scene view state, allow to control if fog, skybox, flares, ... are visible.

renderMode

public DrawCameraMode renderMode { get; set; }

RenderMode of the scene camera, can be get and set.

isRotationLocked

public bool isRotationLocked { get; set; }

size

public float size { get; set; }

Static Properties

lastActiveSceneView

public static SceneView lastActiveSceneView { get; }

The last scene view used by the user.

currentDrawingSceneView

public static SceneView currentDrawingSceneView { get; }

The current rendering scene view in the editor.

sceneViews

public static ArrayList sceneViews { get; }

All the opened Scene tabs in the editor.

Public Methods

Static Methods

FrameLastActiveSceneView

public static bool FrameLastActiveSceneView();

Send a FrameSelected event to the last active scene tab.

FrameLastActiveSceneViewWithLock

public static bool FrameLastActiveSceneViewWithLock();

Send a FrameSelectedWithLock event to the last active scene tab.

GetAllSceneCameras

public static Camera[] GetAllSceneCameras();

Returns all the cameras used in all the scene tabs.

RepaintAll

public static void RepaintAll();

Call the Repaint method on all scene views.

ShowCompileErrorNotification

public static void ShowCompileErrorNotification();

Show a notification with the message "All compiler errors have to be fixed before you can enter playmode!".

Delegates

	public static OnSceneFunc onSceneGUIDelegate;

	public virtual void AddItemsToMenu(GenericMenu menu);
	public void AlignViewToObject(Transform t);
	public void AlignWithView();
	public void FixNegativeSize();
	public bool Frame(Bounds bounds, bool instant = true);
	public bool FrameSelected(bool lockView);
	public bool FrameSelected();
	public void LookAt(Vector3 pos, Quaternion rot, float newSize, bool ortho);
	public void LookAt(Vector3 pos, Quaternion rot, float newSize, bool ortho, bool instant);
	public void LookAt(Vector3 pos, Quaternion rot, float newSize);
	public void LookAt(Vector3 pos, Quaternion rot);
	public void LookAt(Vector3 pos);
	public void LookAtDirect(Vector3 pos, Quaternion rot, float newSize);
	public void LookAtDirect(Vector3 pos, Quaternion rot);
	public void MoveToView();
	public void MoveToView(Transform target);
	public void OnSelectionChange();
	public void SetSceneViewFiltering(bool enable);
	public void SetSceneViewShaderReplace(Shader shader, string replaceString);

	public delegate void OnSceneFunc(SceneView sceneView);