using System;
using UnityEngine;
namespace UnityEngine.Perception.GroundTruth
{
///
/// Marker indicating the GameObject is the root of the ego for a set of sensors. Works with .
/// Custom sensors can use the property to register themselves under this ego.
///
public class Ego : MonoBehaviour
{
///
/// A human-readable description for this Ego to be included in the dataset.
///
public string Description;
EgoHandle m_EgoHandle;
///
/// The EgoHandle registered with the SimulationManager at runtime.
///
public EgoHandle EgoHandle
{
get
{
EnsureEgoInitialized();
return m_EgoHandle;
}
}
void Start()
{
EnsureEgoInitialized();
}
void EnsureEgoInitialized()
{
if (m_EgoHandle == default)
m_EgoHandle = DatasetCapture.RegisterEgo(Description);
}
}
}