SkipUntilNot() public method

Returns the first property editor in this chain that is not an instance of any of the given types.
public SkipUntilNot ( ) : IPropertyEditor
return IPropertyEditor
        protected override void OnEdit(Rect rect, UnityObject behavior, fiGraphMetadata metadata)
        {
            fiGraphMetadataChild childMetadata = metadata.Enter("DefaultBehaviorEditor");

            childMetadata.Metadata.GetPersistentMetadata <fiDropdownMetadata>().ForceDisable();

            // We don't want to get the IObjectPropertyEditor for the given target, which extends
            // UnityObject, so that we can actually edit the property instead of getting a Unity
            // reference field. We also don't want the AbstractTypePropertyEditor, which we will get
            // if the behavior has any derived types.
            PropertyEditorChain editorChain = PropertyEditor.Get(behavior.GetType(), null);
            IPropertyEditor     editor      = editorChain.SkipUntilNot(
                typeof(IObjectPropertyEditor),
                typeof(AbstractTypePropertyEditor));

            // Run the editor
            editor.Edit(rect, GUIContent.none, behavior, childMetadata);
        }
Exemplo n.º 2
0
        protected override float OnGetHeight(UnityObject behavior, fiGraphMetadata metadata)
        {
            fiGraphMetadataChild childMetadata = metadata.Enter("DefaultBehaviorEditor", null);

            childMetadata.Metadata.GetPersistentMetadata <fiDropdownMetadata>().ForceDisable();

            float height = 0;

            // We don't want to get the IObjectPropertyEditor for the given
            // target, which extends UnityObject, so that we can actually edit
            // the property instead of getting a Unity reference field. We also
            // don't want the AbstractTypePropertyEditor, which we will get if
            // the behavior has any derived types.
            PropertyEditorChain editorChain = PropertyEditor.Get(behavior.GetType(), null);
            IPropertyEditor     editor      = editorChain.SkipUntilNot(
                typeof(IObjectPropertyEditor),
                typeof(AbstractTypePropertyEditor));

            height += editor.GetElementHeight(GUIContent.none, behavior, childMetadata);

            return(height);
        }