void IterateCriterion(SerializedProperty criterion, PropertyIteratorCallback onIterateChildProperty) { if (criterion.objectReferenceValue == null) { return; } var serializedObject = GetSerializedObject(criterion); if (serializedObject == null) { return; } var childProperty = serializedObject.GetIterator(); childProperty.NextVisible(true); while (childProperty.NextVisible(childProperty.isExpanded)) { if (string.Equals(childProperty.propertyPath, "m_Script", StringComparison.Ordinal)) { continue; } onIterateChildProperty(childProperty); } }
void IterateCriterion(SerializedProperty criterion, PropertyIteratorCallback onIterateChildProperty) { if (criterion.objectReferenceValue == null) { return; } var serializedObject = GetSerializedObject(criterion); if (serializedObject == null) { return; } // First pass: draw properties of the derived class. var childProperty = serializedObject.GetIterator(); childProperty.NextVisible(true); while (childProperty.NextVisible(childProperty.isExpanded)) { if (k_PropertiesToIgnore.Contains(childProperty.propertyPath)) { continue; } if (k_BaseClassProperties.Contains(childProperty.propertyPath)) { continue; } onIterateChildProperty(childProperty); } // Second pass: draw properties of the base class. childProperty = serializedObject.GetIterator(); childProperty.NextVisible(true); while (childProperty.NextVisible(childProperty.isExpanded)) { if (k_BaseClassProperties.Contains(childProperty.propertyPath)) { onIterateChildProperty(childProperty); } } }