SceneEditorSession
public class SceneEditorSession A SceneEditorSession holds a Scene that is open in the editor. It creates a widget, has a selection and undo system.
Properties
| Name | Type | Description |
|---|---|---|
All static | List<SceneEditorSession> | All open editor sessions |
Active static | SceneEditorSession | The editor session that is currently active |
IsPrefabSession | Boolean | Returns true if this session is editing a prefab |
Scene virtual | Scene | |
ShouldUpdate | Boolean | Should we call Single) while this session is visible? |
OnFrameTo | Action<BBox> | |
HasUnsavedChanges virtual | Boolean | |
GameSession | GameEditorSession | The game session of this editor session, if playing. |
IsPlaying virtual | Boolean | |
Selection virtual | SelectionSystem | |
UndoSystem | UndoSystem |
Methods
virtual Void Destroy() Void MakeActive(Boolean bringToFront = True) Makes this scene active and brings it to the front
Void BringToFront() Bring this scene tab to the front
Void Tick() static IDisposable Scope() Pushes the active scene to the current scope
virtual Void FrameTo(InAttribute) box) Void Reload() virtual Void Save(Boolean saveAs) static SceneEditorSession Resolve(Scene scene) Resolve a scene to an editor session. If it's a game scene, resolves the parent editor session.
static ISceneEditorSession Resolve(Component component) Resolve a Component to an editor session.
static ISceneEditorSession Resolve(GameObject go) Resolve a GameObject to an editor session.
static SceneEditorSession Resolve(SceneFile sceneFile) Resolve a scene file to an editor session.
static SceneEditorSession Resolve(PrefabFile prefabFile) Resolve a prefab file to an editor session.
static SceneEditorSession Resolve(ISourceLocation sourceLocation) Resolve an action graph source location to an editor session.
virtual Void RecordChange(SerializedProperty property) static SceneEditorSession CreateDefault() Make a new SceneEditorSession with a default scene
static SceneEditorSession CreateFromPath(String path) Opens an editor session from an existing scene or prefab
virtual IEnumerable<Object> GetSelection() virtual SceneFolder GetSceneFolder() Void SetPlaying(Scene scene) virtual Void StopPlaying() String SerializeSelection() Serlialize the current selection to a json string. The aim here is to make something we can transfer back to objects.
Void DeserializeSelection(String selection) Take a json string created by SerializeSelection and turn it into a selection
IDisposable SuppressUndoSounds() Temporarily disables undo/redo sounds.
Void FullUndoSnapshot(String title) Take a full scene snapshot for the undo system. This is usually a last resort, if you can't do anything more incremental.
Void PushUndoSelection() Push the current selection into the undo system
virtual Void AddUndo(String name, Action undo, Action redo) virtual ISceneUndoScope UndoScope(String name)