Version: 2021.2
LanguageEnglish
  • C#

PreviewSceneStage.OnOpenStage

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

Cancel

Declaration

protected bool OnOpenStage();

Returns

bool If your Stage opened successfully return true, otherwise return false.

Description

Unity calls this method when the Stage is opened. Classes that inherit from PreviewSceneStage should implement initialization logic in this method.

A Stage can remain open even after another Stage becomes the active Stage. Unity only closes a Stage once it's no longer visible in the Scene view breadcrumb bar. OnOpenStage and OnCloseStage is only called once each.

If you override this method, call the base method base.OnOpenStage() from within the implementation to load the preview Scene associated with the stage. PreviewSceneStage.scene will be valid after that point.