[SerializeField]
public bool showVisualizations = true ;
bool m_ShowingVisualizations ;
/// <summary>
/// The <see cref="SensorHandle"/> associated with this camera. Use this to report additional annotations and metrics at runtime.
/// </summary>
}
#endif
VisualizationCanvas visualizationCanvas = > isVisualizedPerceptionCamera ? s_VisualizationCanvas . GetComponent < VisualizationCanvas > ( ) : null ;
bool isVisualizedPerceptionCamera = > s_VisualizedPerceptionCamera = = this ;
VisualizationCanvas visualizationCanvas = > m_ShowingVisualizations ? s_VisualizationCanvas . GetComponent < VisualizationCanvas > ( ) : null ;
/// <summary>
/// Add a data object which will be added to the dataset with each capture. Overrides existing sensor data associated with the given key.
if ( ! showVisualizations )
return ;
m_ShowingVisualizations = true ;
s_VisualizedPerceptionCamera = this ;
// set up to render to a render texture instead of the screen
}
labeler . InternalOnUpdate ( ) ;
}
//disable async readback when visualizations are enabled to ensure data is read and visualized in the same frame
if ( showVisualizations )
CaptureOptions . useAsyncReadbackIfSupported = false ;
if ( isVisualizedPerceptionCamera )
{
s_VisualizationCanvas . SetActive ( showVisualizations ) ;
}
}