您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

48 行
1.7 KiB

using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Simulation;
using UnityEngine.Perception.GroundTruth.DataModel;
namespace UnityEngine.Perception.GroundTruth
{
public abstract class ConsumerEndpoint
{
IEnumerator WaitForComplete()
{
yield return new WaitUntil(IsComplete);
}
#if false
public virtual bool IsComplete => true;
#else
protected abstract bool IsComplete();
#endif
/// <summary>
/// Called when the simulation begins. Provides simulation wide metadata to
/// the consumer.
/// </summary>
/// <param name="metadata">Metadata describing the active simulation</param>
public abstract void OnSimulationStarted(SimulationMetadata metadata);
public virtual void OnSensorRegistered(SensorDefinition sensor) { }
public virtual void OnAnnotationRegistered(AnnotationDefinition annotationDefinition) { }
public virtual void OnMetricRegistered(MetricDefinition metricDefinition) { }
/// <summary>
/// Called at the end of each frame. Contains all of the generated data for the
/// frame. This method is called after the frame has entirely finished processing.
/// </summary>
/// <param name="frame">The frame data.</param>
public abstract void OnFrameGenerated(Frame frame);
/// <summary>
/// Called at the end of the simulation. Contains metadata describing the entire
/// simulation process.
/// </summary>
/// <param name="metadata">Metadata describing the entire simulation process</param>
public abstract void OnSimulationCompleted(CompletionMetadata metadata);
}
}