docs.unity3d.com
    Show / Hide Table of Contents

    Interface IElementAdderMenuBuilder<TContext>

    Interface for building an IElementAdderMenu.

    Namespace: Unity.VisualScripting.ReorderableList.Element_Adder_Menu
    Syntax
    public interface IElementAdderMenuBuilder<TContext>
    Type Parameters
    Name Description
    TContext

    Type of the context object that elements can be added to.

    Methods

    AddCustomCommand(IElementAdderMenuCommand<TContext>)

    Adds a custom command to the menu.

    Declaration
    void AddCustomCommand(IElementAdderMenuCommand<TContext> command)
    Parameters
    Type Name Description
    IElementAdderMenuCommand<TContext> command

    The custom command.

    Exceptions
    Type Condition
    ArgumentNullException

    If command is null.

    AddTypeFilter(Func<Type, Boolean>)

    Adds a filter function which determines whether types can be included or whether they need to be excluded.

    Declaration
    void AddTypeFilter(Func<Type, bool> typeFilter)
    Parameters
    Type Name Description
    Func<Type, Boolean> typeFilter

    Filter function.

    Remarks

    If a filter function returns a value of false then that type will not be included in the menu interface.

    Exceptions
    Type Condition
    ArgumentNullException

    If typeFilter is null.

    GetMenu()

    Builds and returns a new IElementAdderMenu instance.

    Declaration
    IElementAdderMenu GetMenu()
    Returns
    Type Description
    IElementAdderMenu

    A new IElementAdderMenu instance each time the method is invoked.

    SetContractType(Type)

    Sets contract type of the elements that can be included in the IElementAdderMenu. Only non-abstract class types that are assignable from the contractType will be included in the built menu.

    Declaration
    void SetContractType(Type contractType)
    Parameters
    Type Name Description
    Type contractType

    Contract type of addable elements.

    SetElementAdder(IElementAdder<TContext>)

    Set the IElementAdder<TContext> implementation which is used when adding new elements to the context object.

    Declaration
    void SetElementAdder(IElementAdder<TContext> elementAdder)
    Parameters
    Type Name Description
    IElementAdder<TContext> elementAdder

    Element adder.

    Remarks

    Specify a value of null for elementAdder to prevent the selection of any types.

    SetTypeDisplayNameFormatter(Func<Type, String>)

    Set the function that formats the display of type names in the user interface.

    Declaration
    void SetTypeDisplayNameFormatter(Func<Type, string> formatter)
    Parameters
    Type Name Description
    Func<Type, String> formatter

    Function that formats display name of type; or null.

    Remarks

    Specify a value of null for formatter to assume the default formatting function.

    Extension Methods

    XAnalyserProvider.Analyser(Object, IGraphContext)
    XAnalyserProvider.Analyser<TAnalyser>(Object, IGraphContext)
    XAnalyserProvider.Analysis(Object, IGraphContext)
    XAnalyserProvider.Analysis<TAnalysis>(Object, IGraphContext)
    XAnalyserProvider.Analyser(Object, GraphReference)
    XAnalyserProvider.Analyser<TAnalyser>(Object, GraphReference)
    XAnalyserProvider.Analysis(Object, GraphReference)
    XAnalyserProvider.Analysis<TAnalysis>(Object, GraphReference)
    XDescriptorProvider.Describe(Object)
    XDescriptorProvider.HasDescriptor(Object)
    XDescriptorProvider.Descriptor(Object)
    XDescriptorProvider.Descriptor<TDescriptor>(Object)
    XDescriptorProvider.Description(Object)
    XDescriptorProvider.Description<TDescription>(Object)
    Cloning.Clone(Object, ICloner, Boolean)
    Cloning.Clone<T>(T, ICloner, Boolean)
    Cloning.CloneViaFakeSerialization(Object)
    Cloning.CloneViaFakeSerialization<T>(T)
    ConversionUtility.IsConvertibleTo(Object, Type, Boolean)
    ConversionUtility.IsConvertibleTo<T>(Object, Boolean)
    ConversionUtility.ConvertTo(Object, Type)
    ConversionUtility.ConvertTo<T>(Object)
    TypeUtility.ToShortString(Object, Int32)
    Serialization.CloneViaSerialization<T>(T, Boolean)
    Serialization.CloneViaSerializationInto<TSource, TDestination>(TSource, ref TDestination, Boolean)
    Serialization.Serialize(Object, Boolean)
    LinqUtility.Yield<T>(T)
    UnityObjectUtility.IsUnityNull(Object)
    UnityObjectUtility.ToSafeString(Object)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023