Class LiveStreamExtensions
Extension methods for Live
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 |
---|---|---|
Live |
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 |
---|---|
Live |
A Live |
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 |
---|---|
Argument |
Thrown if the stream is null. |
SetLive(LiveStream, LivePropertyHandle, bool)
Sets the live state of the property associated with the specified Live
Declaration
public static void SetLive(this LiveStream stream, LivePropertyHandle handle, bool value)
Parameters
Type | Name | Description |
---|---|---|
Live |
stream | The stream containing the property. |
Live |
handle | The Live |
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 |
---|---|
Argument |
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 Live
Declaration
public static void SetMaxError(this LiveStream stream, LivePropertyHandle handle, float value)
Parameters
Type | Name | Description |
---|---|---|
Live |
stream | The stream containing the property. |
Live |
handle | The Live |
float | value | The tolerance to set expressed as an error mesurement. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the stream is null. |
SetValue<TValue>(LiveStream, LivePropertyHandle, in TValue)
Sets the value of the property associated with the specified Live
Declaration
public static void SetValue<TValue>(this LiveStream stream, LivePropertyHandle handle, in TValue value) where TValue : struct
Parameters
Type | Name | Description |
---|---|---|
Live |
stream | The stream containing the property. |
Live |
handle | The Live |
TValue | value | The value to set to the property. |
Type Parameters
Name | Description |
---|---|
TValue | The type of the data to retrieve. |
Exceptions
Type | Condition |
---|---|
Argument |
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 |
---|---|---|
Live |
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. |
Live |
handle | The returned property handle instance, or default if the property handle was not found. |
Returns
Exceptions
Type | Condition |
---|---|
Argument |
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 |
---|---|---|
Live |
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. |
Live |
handle | The returned property handle instance, or default if the property handle was not found. |
Returns
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the stream is null. |
TryGetValue<TValue>(LiveStream, LivePropertyHandle, out TValue)
Attempts to get the value of the property associated with the specified Live
Declaration
public static bool TryGetValue<TValue>(this LiveStream stream, LivePropertyHandle handle, out TValue value) where TValue : struct
Parameters
Type | Name | Description |
---|---|---|
Live |
stream | The stream containing the property. |
Live |
handle | The Live |
TValue | value | The value stored in the property. |
Returns
Type Parameters
Name | Description |
---|---|
TValue | The type of the data to retrieve. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the stream is null. |