[ValueSelector]

Displays a field with a dropdown populated from a custom collection.

Parameters

Parameter Name
Arguments
Description

name

string

Name of a member that returns the dropdown values.

Searchable

bool

Allow the user to search for values.

FilterValues

string[]

Values to filter from the dropdown list (matched by ToString() representation).

FilterMode

SelectorFilter

Filter mode to apply to the values.

Examples

using System.Collections.Generic;
using UnityEngine;
using RenownedGames.Apex;

public class ValueSelectorExample : MonoBehaviour
{
    [ValueSelector("GetValues")]
    public string selectedValue;

    [ValueSelector("GetValues", Searchable = true)]
    public string searchableValue;

    private IEnumerable<string> GetValues()
    {
        return new string[] { "Option A", "Option B", "Option C" };
    }
}

Last updated