TypeSelector

A feature-rich type selector.

namespace Sirenix.OdinInspector.Editor
{
public class TypeSelector : OdinSelector<Type>
}

Requirements

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector
Version: 2.0.0.0

Methods

Return Type Definition Description
void BuildSelectionTree(OdinMenuTree) Builds the selection tree.
float DefaultWindowWidth() 450
void SetSelection(Type) Sets the selected types.

Example

Type[] selectedTypes;

void OnGUI()
{
    // Use the selector manually. See the documentation for OdinSelector for more information.
    if (GUILayout.Button("Open My Selector"))
    {
        TypeSelector selector = new TypeSelector(customListOfTypes);
        TypeSelector selector = new TypeSelector(AssemblyTypeFlags.CustomTypes, supportsMultiSelect: true);
        selector.SetSelection(this.selectedTypes);
        selector.SelectionConfirmed += selection => this.selectedTypes = selection.ToArray();
        selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well.
    }
}