A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.unity3d.com/ScriptReference/SceneManagement.EditorSceneManager.SaveScene.html below:

Unity - Scripting API: SceneManagement.EditorSceneManager.SaveScene

EditorSceneManager.SaveScene 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 Your name Your email Suggestion*

Cancel

Declaration

public static bool

SaveScene

(

SceneManagement.Scene scene

, string

dstScenePath

= "", bool

saveAsCopy

= false);

Parameters Parameter Description scene The Scene to be saved. dstScenePath The file path to save the Scene to. If the path is empty, the current open Scene is overwritten. If it has not yet been saved at all, a save dialog is shown. saveAsCopy If set to true, the Scene is saved without changing the current Scene, and without clearing the unsaved changes marker. Returns

bool True if the save succeeded, otherwise false.

Description

Save a Scene.

All paths are relative to the project folder, such as: "Assets/MyScenes/MyScene.unity". Folders specified in the path must already exist before calling the function. If no path is specified, the path of the current open Scene is used, except if it was never saved before, in which case a save dialog is shown.

The function returns false if the save failed. This can happen if the specified path is invalid or if the user cancels in the case of a save dialog.

Additional resources: EditorSceneManager.GetActiveScene

Example:


Simple Editor Window that saves each 300 seconds the current Scene.

Note: This saves the Scene whether it is marked dirty or not.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4