docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LiveStreamExtensions

    Extension methods for LiveStream.

    Inheritance
    object
    LiveStreamExtensions
    Namespace: Unity.LiveCapture
    Assembly: Unity.LiveCapture.dll
    Syntax
    public static class LiveStreamExtensions

    Methods

    CreateProperty<TComponent, TValue>(LiveStream, string, Action<TComponent, TValue>)

    Creates a property from the specified binding information at the root transform.

    Declaration
    public static LivePropertyHandle CreateProperty<TComponent, TValue>(this LiveStream stream, string propertyName, Action<TComponent, TValue> setter = null) where TComponent : Component where TValue : struct
    Parameters
    Type Name Description
    LiveStream stream

    The stream to create the property to.

    string propertyName

    The name of the property to bind to.

    Action<TComponent, TValue> setter

    The action that sets the value to the component's property. This is needed for some builtin components where the property can't be set using reflection.

    Returns
    Type Description
    LivePropertyHandle

    A LivePropertyHandle representing the property.

    Type Parameters
    Name Description
    TComponent

    The type of the component to bind to.

    TValue

    The type of the data to bind to.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream is null.

    SetLive(LiveStream, LivePropertyHandle, bool)

    Sets the live state of the property associated with the specified LivePropertyHandle.

    Declaration
    public static void SetLive(this LiveStream stream, LivePropertyHandle handle, bool value)
    Parameters
    Type Name Description
    LiveStream stream

    The stream containing the property.

    LivePropertyHandle handle

    The LivePropertyHandle representing the property.

    bool value

    The live state to set to the property.

    Remarks

    A property with its live state set to true will animate its target component and participate in an ongoing recording. A live state set to false, won't.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream is null.

    SetMaxError(LiveStream, LivePropertyHandle, float)

    Sets the tolerance to use when reducing keyframes during a recording of the property associated with the specified LivePropertyHandle.

    Declaration
    public static void SetMaxError(this LiveStream stream, LivePropertyHandle handle, float value)
    Parameters
    Type Name Description
    LiveStream stream

    The stream containing the property.

    LivePropertyHandle handle

    The LivePropertyHandle representing the property.

    float value

    The tolerance to set expressed as an error mesurement.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream is null.

    SetValue<TValue>(LiveStream, LivePropertyHandle, in TValue)

    Sets the value of the property associated with the specified LivePropertyHandle.

    Declaration
    public static void SetValue<TValue>(this LiveStream stream, LivePropertyHandle handle, in TValue value) where TValue : struct
    Parameters
    Type Name Description
    LiveStream stream

    The stream containing the property.

    LivePropertyHandle handle

    The LivePropertyHandle representing the property.

    TValue value

    The value to set to the property.

    Type Parameters
    Name Description
    TValue

    The type of the data to retrieve.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream is null.

    TryGetHandle(LiveStream, string, string, Type, out LivePropertyHandle)

    Attemps to retrieve an already created property from the stream.

    Declaration
    public static bool TryGetHandle(this LiveStream stream, string relativePath, string propertyName, Type type, out LivePropertyHandle handle)
    Parameters
    Type Name Description
    LiveStream stream

    The stream to create the property to.

    string relativePath

    The path from the root transform where the component to bind to is.

    string propertyName

    The name of the property to bind to.

    Type type

    The type of the component to bind to.

    LivePropertyHandle handle

    The returned property handle instance, or default if the property handle was not found.

    Returns
    Type Description
    bool

    true if the property handle was found, otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream is null.

    TryGetHandle(LiveStream, string, Type, out LivePropertyHandle)

    Attemps to retrieve an already created property from the stream at the root transform.

    Declaration
    public static bool TryGetHandle(this LiveStream stream, string propertyName, Type type, out LivePropertyHandle handle)
    Parameters
    Type Name Description
    LiveStream stream

    The stream to create the property to.

    string propertyName

    The name of the property to bind to.

    Type type

    The type of the component to bind to.

    LivePropertyHandle handle

    The returned property handle instance, or default if the property handle was not found.

    Returns
    Type Description
    bool

    true if the property handle was found, otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream is null.

    TryGetValue<TValue>(LiveStream, LivePropertyHandle, out TValue)

    Attempts to get the value of the property associated with the specified LivePropertyHandle.

    Declaration
    public static bool TryGetValue<TValue>(this LiveStream stream, LivePropertyHandle handle, out TValue value) where TValue : struct
    Parameters
    Type Name Description
    LiveStream stream

    The stream containing the property.

    LivePropertyHandle handle

    The LivePropertyHandle representing the property.

    TValue value

    The value stored in the property.

    Returns
    Type Description
    bool

    true if the value was found, otherwise, false.

    Type Parameters
    Name Description
    TValue

    The type of the data to retrieve.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream is null.

    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)