PreviewSceneStage
class in
UnityEditor.SceneManagement
/
Inherits from:SceneManagement.Stage
Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Description
The PreviewSceneStage class represents an editing context based on a single preview Scene.
You can create a custom type of Stage by implementing a class that inherits from the abstract PreviewSceneStage class. Your custom Stage should ensure any content it controls is moved into the preview Scene that the stage controls.
Your custom Stage class should implement OnOpenStage and OnCloseStage. Unity calls those methods when your stage is opened and closed; you should not call them yourself. To open a Stage of your custom type, use StageUtility.GoToStage.
Properties
scene | The preview Scene this stage controls. Stage content should be moved into this Scene. |
stageHandle | See Stage.stageHandle. |
Protected Methods
OnCloseStage | Unity calls this method when the Stage is closed. Classes that inherit from PreviewSceneStage should implement cleanup logic in this method. |
OnOpenStage | Unity calls this method when the Stage is opened. Classes that inherit from PreviewSceneStage should implement initialization logic in this method. |
Inherited Members
Properties
hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
name | The name of the object. |
assetPath | The path of the Asset file associated with the stage, relative to the project root folder. |
stageHandle | The StageHandle struct for this stage. |
Protected Methods
CreateHeaderContent | Creates the header content for this Stage. Both the Hierarchy window header and Scene view breadcrumb bar use this content. |
GetHashForStateStorage | Unity calls this method to get a hash code that is used to save the state of the Stage to disk. |
OnDisable | See ScriptableObject.OnDisable. |
OnEnable | See ScriptableObject.OnEnable. |
OnFirstTimeOpenStageInSceneView | Unity calls this method the first time a Stage is opened for a specific Asset, for a specific Scene view. |
OnReturnToStage | Unity calls this method when you return to a Stage that is already open. |
Operators
bool | Does the object exist? |
operator != | Compares if two objects refer to a different object. |
operator == | Compares two object references to see if they refer to the same object. |
Messages
Awake | This function is called when the ScriptableObject script is started. |
OnDestroy | This function is called when the scriptable object will be destroyed. |
OnDisable | This function is called when the scriptable object goes out of scope. |
OnEnable | This function is called when the object is loaded. |
OnValidate | Editor-only function that Unity calls when the script is loaded or a value changes in the Inspector. |
Reset | Reset to default values. |