docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SceneTemplate

    Inheritance
    object
    SceneTemplate
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEditor.SceneTemplate
    Assembly: solution.dll
    Syntax
    public static class SceneTemplate

    Methods

    CreateSceneTemplate(string)

    Create a new Scene template at a specific path. This scene template won't be bound to a scene.

    Declaration
    public static SceneTemplateAsset CreateSceneTemplate(string sceneTemplatePath)
    Parameters
    Type Name Description
    string sceneTemplatePath

    Path of the new scene template asset

    Returns
    Type Description
    SceneTemplateAsset

    A new scene template asset instance

    CreateTemplateFromScene(SceneAsset, string)

    Create a new scene template bound to a specific scene. All its dependencies will automatically be extracted and set to reference.

    Declaration
    public static SceneTemplateAsset CreateTemplateFromScene(SceneAsset sourceSceneAsset, string sceneTemplatePath)
    Parameters
    Type Name Description
    SceneAsset sourceSceneAsset

    Scene asset that will serve as the template

    string sceneTemplatePath

    new path os the Scene template asset

    Returns
    Type Description
    SceneTemplateAsset

    A new scene template asset instance

    Instantiate(SceneTemplateAsset, bool, string)

    Instantiate a new scene from a template.

    Declaration
    public static Tuple<Scene, SceneAsset> Instantiate(SceneTemplateAsset sceneTemplate, bool loadAdditively, string newSceneOutputPath = null)
    Parameters
    Type Name Description
    SceneTemplateAsset sceneTemplate

    Scene template asset containing all information to properly instantiate the scene.

    bool loadAdditively

    Is the new scene created additively in the currently loaded scene.

    string newSceneOutputPath

    If the new scene needs to be saved on disk, it will be its path.

    Returns
    Type Description
    Tuple<Scene, SceneAsset>

    It returns a tuple of the newly created scene and its matching scene asset

    Events

    newSceneTemplateInstantiated

    Events fired after a template is instantiated.

    Declaration
    public static event SceneTemplate.NewTemplateInstantiated newSceneTemplateInstantiated
    Event Type
    Type Description
    SceneTemplate.NewTemplateInstantiated

    newSceneTemplateInstantiating

    Events fired before a template is instantiated

    Declaration
    public static event SceneTemplate.NewTemplateInstantiating newSceneTemplateInstantiating
    Event Type
    Type Description
    SceneTemplate.NewTemplateInstantiating
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)