浏览代码

Disabling visualizations in non-development players. Making it so the inspector is non-editable in play mode to work around the myriad of issues with inspector changes in play mode seemingly stemming from usages of SerializeReference

/aisv647_visualizations
Jon Hogins 4 年前
当前提交
d2b95d3a
共有 2 个文件被更改,包括 19 次插入9 次删除
  1. 20
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs
  2. 8
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs

20
com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs


public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.description)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.period)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.startTime)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.showVisualizations)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.captureRgbImages)));
serializedObject.ApplyModifiedProperties();
//EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.labelers)));
m_LabelersList.DoLayoutList();
using(new EditorGUI.DisabledScope(EditorApplication.isPlaying))
{
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.description)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.period)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.startTime)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.showVisualizations)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.captureRgbImages)));
serializedObject.ApplyModifiedProperties();
//EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.labelers)));
m_LabelersList.DoLayoutList();
}
if (EditorSettings.asyncShaderCompilation)
{
EditorGUILayout.HelpBox("Asynchronous shader compilation may result in invalid data in beginning frames. This can be disabled in Project Settings -> Edtior -> Asynchronous Shader Compilation", MessageType.Warning);

8
com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs


SetupInstanceSegmentation();
var cam = GetComponent<Camera>();
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#endif
DatasetCapture.SimulationEnding += OnSimulationEnding;
}

if (!SensorHandle.IsValid)
return;
bool anyVisualizing = false;
foreach (var labeler in m_Labelers)
{
if (!labeler.enabled)

}
labeler.InternalOnUpdate();
anyVisualizing |= labeler.InternalVisualizationEnabled;
if (m_ShowingVisualizations)
CaptureOptions.useAsyncReadbackIfSupported = !anyVisualizing;
}
void LateUpdate()

正在加载...
取消
保存