docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SceneTemplateAsset

    Asset storing everything needed to instantiate a scene from a templated scene

    Inheritance
    object
    Object
    ScriptableObject
    SceneTemplateAsset
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEditor.SceneTemplate
    Assembly: solution.dll
    Syntax
    [Serializable]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.scene-template@latest/")]
    [CreateAssetMenu(menuName = "Scene Template", order = 201)]
    public class SceneTemplateAsset : ScriptableObject

    Fields

    addToDefaults

    If this template is tagged as add to defaults, it will be put in the defaults list of the new scene dialog.

    Declaration
    public bool addToDefaults
    Field Value
    Type Description
    bool

    dependencies

    List of dependencies of the scene and what to do (Clone or Reference) with each dependency.

    Declaration
    public DependencyInfo[] dependencies
    Field Value
    Type Description
    DependencyInfo[]

    description

    Description of the template (can be long, displayed in multiline UI).

    Declaration
    public string description
    Field Value
    Type Description
    string

    preview

    Preview/Icon of the template.

    Declaration
    public Texture2D preview
    Field Value
    Type Description
    Texture2D

    templateName

    Pretty name for the template asset. By default: the file name of the template

    Declaration
    public string templateName
    Field Value
    Type Description
    string

    templatePipeline

    Script dering from ISceneTemplatePipeline allowing custom code to be executed on template instantiation.

    Declaration
    public MonoScript templatePipeline
    Field Value
    Type Description
    MonoScript

    templateScene

    Scene that will be copied when instantiating the template

    Declaration
    public SceneAsset templateScene
    Field Value
    Type Description
    SceneAsset

    Properties

    IsValid

    Is the template valid? If not it wont be displayed in the New Scene Dialog.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    bool

    Methods

    AddThumbnailToAsset(Texture2D)

    Set the preview of the template and store it in the template asset itself.

    Declaration
    public void AddThumbnailToAsset(Texture2D thumbnail)
    Parameters
    Type Name Description
    Texture2D thumbnail

    Thumbnail or preview of the template

    BindScene(SceneAsset)

    Assign a new scene to the template and recompute all dependencies

    Declaration
    public void BindScene(SceneAsset scene)
    Parameters
    Type Name Description
    SceneAsset scene

    CreatePipeline()

    Instantiate a SceneTemplatePipeline. This is done on each template instantiation.

    Declaration
    public ISceneTemplatePipeline CreatePipeline()
    Returns
    Type Description
    ISceneTemplatePipeline

    New instance of a ISceneTemplatePipeline that will be notified throughout the whole template instantiation process

    IsValidPipeline(MonoScript)

    Validate if a given script contains a class deriving from ISceneTemplatePipeline

    Declaration
    public static bool IsValidPipeline(MonoScript script)
    Parameters
    Type Name Description
    MonoScript script

    Script to check if ISceneTemplatePipeline instance is available.

    Returns
    Type Description
    bool

    True if the given script implements ISceneTemplatePipeline

    UpdateDependencies()

    Refresh all the dependencies of the template.

    Declaration
    public void UpdateDependencies()
    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)