您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
41 行
1.1 KiB
41 行
1.1 KiB
using System;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEngine.Perception.GroundTruth
|
|
{
|
|
/// <summary>
|
|
/// Marker indicating the GameObject is the root of the ego for a set of sensors. Works with <see cref="PerceptionCamera"/>.
|
|
/// Custom sensors can use the <see cref="EgoHandle"/> property to register themselves under this ego.
|
|
/// </summary>
|
|
public class Ego : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// A human-readable description for this Ego to be included in the dataset.
|
|
/// </summary>
|
|
public string Description;
|
|
EgoHandle m_EgoHandle;
|
|
|
|
/// <summary>
|
|
/// The EgoHandle registered with the SimulationManager at runtime.
|
|
/// </summary>
|
|
public EgoHandle EgoHandle
|
|
{
|
|
get
|
|
{
|
|
EnsureEgoInitialized();
|
|
return m_EgoHandle;
|
|
}
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
EnsureEgoInitialized();
|
|
}
|
|
|
|
void EnsureEgoInitialized()
|
|
{
|
|
if (m_EgoHandle == default)
|
|
m_EgoHandle = SimulationManager.RegisterEgo(Description);
|
|
}
|
|
}
|
|
}
|