Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

DropdownAttribute

A topic by CatyboyStudio created Oct 14, 2022 Views: 72
Viewing posts 1 to 1

Select the data using UIElements PopupField

[Dropdown(nameof(FieldDS), refreshButton: true)]
public int Value1;
 
public int[] FieldDS = new int[] { 1, 2, 3 };

 Dropdown's data sources support properties and methods. The method returns data support DropdownList, ICollection, IEnumerable

 Data source method sample

protected DropdownList MethodDS()
{
    return new DropdownList()
    {
      { Vector3.right, "Right" },
      { Vector3.up, "Up" },
      { Vector3.forward, "Forward" }
    };
}

 When the “refreshButton” parameter is True, a “R” button will appear next to the control, and the options in the list can be refreshed after clicking

  When the “refresher” parameter is associated with a property, the options in the list can be refreshed after the refresher property changed