public void Draw(SerializedProperty property, ControlRect layout) { if (m_ImporterReferenceSerializedProperty == null || m_PropertiesArraySerializedProperty == null) { List <string> propertyNames = new List <string> { "m_ImporterReference", "m_ConstrainProperties" }; List <SerializedProperty> properties = SerializationUtilities.FindPropertiesInClass(property, propertyNames); m_ImporterReferenceSerializedProperty = properties[0]; m_PropertiesArraySerializedProperty = properties[1]; if (m_ImporterReferenceSerializedProperty == null || m_PropertiesArraySerializedProperty == null) { Debug.LogError("Invalid properties for ImporterPropertiesModule"); return; } } if (m_Module == null) { AuditProfile profile = property.serializedObject.targetObject as AuditProfile; if (profile == null) { Debug.LogError("ImporterPropertiesModule must be apart of a profile Object"); return; } m_Module = profile.m_ImporterModule; } if (m_ImporterReferenceSerializedProperty != null) { using (var check = new EditorGUI.ChangeCheckScope()) { EditorGUI.PropertyField(layout.Get(), m_ImporterReferenceSerializedProperty, new GUIContent("Importer Template")); if (check.changed) { m_Module.m_AssetImporter = null; m_Module.GatherProperties(); } } } if (m_ImporterReferenceSerializedProperty.objectReferenceValue != null) { ConstrainToPropertiesArea(layout); } else { Rect r = layout.Get(25); EditorGUI.HelpBox(r, "No template Object to constrain properties on.", MessageType.Warning); } }