Class BuildContext | Scriptable Build Pipeline | 1.5.10
docs.unity3d.com
    Show / Hide Table of Contents

    Class BuildContext

    Basic implementation of IBuildContext. Stores data generated during a build. IBuildContext

    Inheritance
    Object
    BuildContext
    Namespace: UnityEditor.Build.Pipeline
    Syntax
    public class BuildContext : IBuildContext

    Constructors

    BuildContext()

    Default constructor

    Declaration
    public BuildContext()

    BuildContext(IContextObject[])

    Default constructor, adds the passed in parameters to the context.

    Declaration
    public BuildContext(params IContextObject[] buildParams)
    Parameters
    Type Name Description
    IContextObject[] buildParams

    The set of initial parameters to add to the context.

    Methods

    ContainsContextObject(Type)

    Checks the build context for existence of a data that is of the specified type.

    Declaration
    public bool ContainsContextObject(Type type)
    Parameters
    Type Name Description
    Type type

    Type of data to check for existence.

    Returns
    Type Description
    Boolean

    true if the context contains specified type of data; otherwise, false.

    Implements
    IBuildContext.ContainsContextObject(Type)

    ContainsContextObject<T>()

    Checks the build context for existence of a data that is of the specified type.

    Declaration
    public bool ContainsContextObject<T>()
        where T : IContextObject
    Returns
    Type Description
    Boolean

    true if the context contains specified type of data; otherwise, false.

    Type Parameters
    Name Description
    T

    Type of data to check for existence.

    Implements
    IBuildContext.ContainsContextObject<T>()

    GetContextObject(Type)

    Gets the data of the specified type contained in the build context.

    Declaration
    public IContextObject GetContextObject(Type type)
    Parameters
    Type Name Description
    Type type

    Type of data to return.

    Returns
    Type Description
    IContextObject

    The type of data specified.

    Implements
    IBuildContext.GetContextObject(Type)

    GetContextObject<T>()

    Gets the data of the specified type contained in the build context.

    Declaration
    public T GetContextObject<T>()
        where T : IContextObject
    Returns
    Type Description
    T

    The type of data specified.

    Type Parameters
    Name Description
    T

    Type of data to return.

    Implements
    IBuildContext.GetContextObject<T>()

    SetContextObject(Type, IContextObject)

    Adds the data of the specified type to the build context.

    Declaration
    public void SetContextObject(Type type, IContextObject contextObject)
    Parameters
    Type Name Description
    Type type

    Type of data to add.

    IContextObject contextObject

    Object holding the data to add.

    Implements
    IBuildContext.SetContextObject(Type, IContextObject)

    SetContextObject(IContextObject)

    Adds the data to the build context. Type will be inferred using Reflection.

    Declaration
    public void SetContextObject(IContextObject contextObject)
    Parameters
    Type Name Description
    IContextObject contextObject

    Object holding the data to add.

    Implements
    IBuildContext.SetContextObject(IContextObject)

    SetContextObject<T>(IContextObject)

    Adds the data of the specified type to the build context.

    Declaration
    public void SetContextObject<T>(IContextObject contextObject)
        where T : IContextObject
    Parameters
    Type Name Description
    IContextObject contextObject

    Object holding the data to add.

    Type Parameters
    Name Description
    T

    Type of data to add.

    Implements
    IBuildContext.SetContextObject<T>(IContextObject)

    TryGetContextObject(Type, out IContextObject)

    Tries to get the data of the specified type contained in the build context.

    Declaration
    public bool TryGetContextObject(Type type, out IContextObject contextObject)
    Parameters
    Type Name Description
    Type type

    Type of data to return.

    IContextObject contextObject

    The object holding the data to be returned if found.

    Returns
    Type Description
    Boolean

    true if the context was able to returned the specified data; otherwise, false.

    Implements
    IBuildContext.TryGetContextObject(Type, out IContextObject)

    TryGetContextObject<T>(out T)

    Declaration
    public bool TryGetContextObject<T>(out T contextObject)
        where T : IContextObject
    Parameters
    Type Name Description
    T contextObject
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    T
    Implements
    IBuildContext.TryGetContextObject<T>(out T)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023