s&box docs

public class Editor.SceneEditorSession

A SceneEditorSession holds a Scene that is open in the editor. It creates a widget, has a selection and undo system.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 29 methods

public virtual sealed void AddUndo(string name, System.Action undo, System.Action redo)

public void BringToFront()

Bring this scene tab to the front

public static Editor.SceneEditorSession CreateDefault()

Make a new SceneEditorSession with a default scene

public static Editor.SceneEditorSession CreateFromPath(string path)

Opens an editor session from an existing scene or prefab

public void DeserializeSelection(string selection)

Take a json string created by SerializeSelection and turn it into a selection

public virtual void Destroy()

public virtual void FrameTo(BBox& modreq(System.Runtime.InteropServices.InAttribute) box)

public void FullUndoSnapshot(string title)Obsolete

Take a full scene snapshot for the undo system. This is usually a last resort, if you can't do anything more incremental.

Obsolete: Manual full scene undo snapshots are no longer working use UndoScope or AddUndo

public virtual sealed Editor.SceneFolder GetSceneFolder()

public virtual sealed System.Collections.Generic.IEnumerable`1<object> GetSelection()

public void MakeActive(bool bringToFront = True)

Makes this scene active and brings it to the front

Parameters

  • bringToFront: Default: True

protected virtual void OnEdited()

public void PushUndoSelection()Obsolete

Push the current selection into the undo system

Obsolete: Manual selections snapshots are no longer working use UndoScope or AddUndo

public virtual sealed void RecordChange(Sandbox.SerializedProperty property)Obsolete

Obsolete: This API member is obsolete.

public void Reload()

public virtual sealed void Save(bool saveAs)

public static System.IDisposable Scope()

Pushes the active scene to the current scope

public string SerializeSelection()

Serlialize the current selection to a json string. The aim here is to make something we can transfer back to objects.

public void SetPlaying(Sandbox.Scene scene)

public virtual void StopPlaying()

public System.IDisposable SuppressUndoSounds()

Temporarily disables undo/redo sounds.

public void Tick()

Properties

Showing 11 properties

public bool Editor.SceneEditorSession.IsPrefabSession { get; set; }

Returns true if this session is editing a prefab

public bool Editor.SceneEditorSession.ShouldUpdate { get; set; }

Should we call `Sandbox.Scene.EditorTick(System.Single,System.Single)` while this session is visible?

Metadata

FieldValue
NamespaceEditor
Typeclass
AssemblySandbox.Tools
Doc IDT:Editor.SceneEditorSession

On this page

Constructorsprotected SceneEditorSession(Sandbox.Scene scene)Methodspublic virtual sealed System.Void AddUndo(System.String name, System.Action undo, System.Action redo)public System.Void BringToFront()public static Editor.SceneEditorSession CreateDefault()public static Editor.SceneEditorSession CreateFromPath(System.String path)public System.Void DeserializeSelection(System.String selection)public virtual System.Void Destroy()public virtual System.Void FrameTo(BBox& modreq(System.Runtime.InteropServices.InAttribute) box)public System.Void FullUndoSnapshot(System.String title)public virtual sealed Editor.SceneFolder GetSceneFolder()public virtual sealed System.Collections.Generic.IEnumerable`1<System.Object> GetSelection()public System.Void MakeActive(System.Boolean bringToFront = True)protected virtual System.Void OnEdited()public System.Void PushUndoSelection()public virtual sealed System.Void RecordChange(Sandbox.SerializedProperty property)public System.Void Reload()public static Editor.SceneEditorSession Resolve(Facepunch.ActionGraphs.ISourceLocation sourceLocation)public static Sandbox.Scene.ISceneEditorSession Resolve(Sandbox.Component component)public static Sandbox.Scene.ISceneEditorSession Resolve(Sandbox.GameObject go)public static Editor.SceneEditorSession Resolve(Sandbox.PrefabFile prefabFile)public static Editor.SceneEditorSession Resolve(Sandbox.Scene scene)public static Editor.SceneEditorSession Resolve(Sandbox.SceneFile sceneFile)public virtual sealed System.Void Save(System.Boolean saveAs)public static System.IDisposable Scope()public System.String SerializeSelection()public System.Void SetPlaying(Sandbox.Scene scene)public virtual System.Void StopPlaying()public System.IDisposable SuppressUndoSounds()public System.Void Tick()public virtual sealed ISceneUndoScope UndoScope(System.String name)Propertiespublic static Editor.SceneEditorSession Editor.SceneEditorSession.Active { get; set; }public static System.Collections.Generic.List`1<Editor.SceneEditorSession> Editor.SceneEditorSession.All { get; set; }public Editor.GameEditorSession Editor.SceneEditorSession.GameSession { get; set; }public virtual sealed System.Boolean Editor.SceneEditorSession.HasUnsavedChanges { get; set; }public virtual System.Boolean Editor.SceneEditorSession.IsPlaying { get; set; }public System.Boolean Editor.SceneEditorSession.IsPrefabSession { get; set; }public System.Action`1<BBox> Editor.SceneEditorSession.OnFrameTo { get; set; }public virtual sealed Sandbox.Scene Editor.SceneEditorSession.Scene { get; set; }public virtual sealed Sandbox.SelectionSystem Editor.SceneEditorSession.Selection { get; set; }public System.Boolean Editor.SceneEditorSession.ShouldUpdate { get; set; }public Sandbox.Helpers.UndoSystem Editor.SceneEditorSession.UndoSystem { get; set; }Metadata