|
|
|
|
|
|
|
|
|
|
public void OnEnable() |
|
|
|
{ |
|
|
|
// m_LabelersList = new ReorderableList(this.serializedObject, this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)), true, false, true, true);
|
|
|
|
// m_LabelersList.elementHeightCallback = GetElementHeight;
|
|
|
|
// m_LabelersList.drawElementCallback = DrawElement;
|
|
|
|
// m_LabelersList.onAddCallback += OnAdd;
|
|
|
|
// m_LabelersList.onRemoveCallback += OnRemove;
|
|
|
|
m_LabelersList = new ReorderableList(this.serializedObject, this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)), true, false, true, true); |
|
|
|
m_LabelersList.elementHeightCallback = GetElementHeight; |
|
|
|
m_LabelersList.drawElementCallback = DrawElement; |
|
|
|
m_LabelersList.onAddCallback += OnAdd; |
|
|
|
m_LabelersList.onRemoveCallback += OnRemove; |
|
|
|
throw new System.NotImplementedException(); |
|
|
|
var serializedProperty = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)); |
|
|
|
var element = serializedProperty.GetArrayElementAtIndex(index); |
|
|
|
var editor = Editor.CreateEditor(element.managedReferenceValue); |
|
|
|
return 10; |
|
|
|
throw new NotImplementedException(); |
|
|
|
var element = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)).GetArrayElementAtIndex(index); |
|
|
|
var editor = Editor.CreateEditor(element.managedReferenceValue); |
|
|
|
editor.OnInspectorGUI(); |
|
|
|
} |
|
|
|
|
|
|
|
void OnRemove(ReorderableList list) |
|
|
|
|
|
|
|
|
|
|
void OnAdd(ReorderableList list) |
|
|
|
{ |
|
|
|
throw new System.NotImplementedException(); |
|
|
|
var labelers = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)); |
|
|
|
labelers.InsertArrayElementAtIndex(0); |
|
|
|
var element = labelers.GetArrayElementAtIndex(0); |
|
|
|
element.managedReferenceValue = new BoundingBoxLabeler(); |
|
|
|
serializedObject.ApplyModifiedProperties(); |
|
|
|
} |
|
|
|
|
|
|
|
public override void OnInspectorGUI() |
|
|
|
|
|
|
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.startTime))); |
|
|
|
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.captureRgbImages))); |
|
|
|
//m_LabelersList.DoLayoutList();
|
|
|
|
//EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.labelers)));
|
|
|
|
m_LabelersList.DoLayoutList(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |