Struct AsyncMetric
Handle to a metric whose values may be reported in a subsequent frame.
Inherited Members
Namespace: UnityEngine.Perception.GroundTruth
Syntax
public struct AsyncMetric
Fields
MetricDefinition
The MetricDefinition associated with this AsyncMetric.
Declaration
public readonly MetricDefinition MetricDefinition
Field Value
Type | Description |
---|---|
MetricDefinition |
Properties
IsNil
Returns true if the AsyncMetric is its default value.
Declaration
public bool IsNil { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsPending
True if ReportValues has not been called yet.
Declaration
public bool IsPending { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsValid
True if the simulation is still running.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
ReportValues(String)
Report the values for this AsyncMetric. Calling this method will transition IsPending to false. ReportValues may only be called once per AsyncMetric.
Declaration
public void ReportValues(string valuesJsonArray)
Parameters
Type | Name | Description |
---|---|---|
String | valuesJsonArray | A JSON array in string form. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if values is null |
ReportValues<T>(T[])
Report the values for this AsyncMetric. Calling this method will transition IsPending to false. ReportValues may only be called once per AsyncMetric.
Declaration
public void ReportValues<T>(T[] values)
Parameters
Type | Name | Description |
---|---|---|
T[] | values | The values to report for the metric. These values will be converted to json. |
Type Parameters
Name | Description |
---|---|
T | The type of the values |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if values is null |