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;
public EgoHandle EgoHandle
{
get
{
EnsureEgoInitialized();
return m_EgoHandle;
}
}
void Start()
{
EnsureEgoInitialized();
}
void EnsureEgoInitialized()
{
if (m_EgoHandle == default)
m_EgoHandle = SimulationManager.RegisterEgo(Description);
}
}
}