![]() |
Ryle Radio 1.0.0
An open-source "radio" system for Unity, allowing tracks, tuning, broadcasters, and more!
|
A custom attribute that allows ints to display as a multiselect dropdown for a given collection, like a custom LayerMask. Due to int limitations you can only have up to 32 options. More...
Public Member Functions | |
| MultiselectAttribute (string _optionsName) | |
| Initialises the attribute. | |
Static Public Member Functions | |
| static T[] | To< T > (int _flags, T[] _options) |
| Converts an int with the Multiselect attribute to a subset of a given list according to the int flags- converts the flag int to usable data. | |
| static int[] | ToInt (int _flags) |
| Shorthand for MultiselectAttribute.To<int>(_flags, _options). Useful for converting a multiselect to indexes in a list. | |
Properties | |
| string | OptionsName [get, private set] |
| Name of the variable this attribute uses for the options list. | |
| static int[] | ZeroTo31 [get] |
| A filler array with numbers 0 - 31, used when converting from a flag int to a list subset. | |
| static int[] | OneTo32 [get] |
| A filler array with numbers 1 - 32. Not yet used, but theoretically helpful for indexing from the end of a list (list[^i] instead of list[i]) | |
A custom attribute that allows ints to display as a multiselect dropdown for a given collection, like a custom LayerMask. Due to int limitations you can only have up to 32 options.
Has editor code in MultiselectDrawer
Definition at line 21 of file MultiselectAttribute.cs.
| RyleRadio.MultiselectAttribute.MultiselectAttribute | ( | string | _optionsName | ) |
Initialises the attribute.
Definition at line 55 of file MultiselectAttribute.cs.
|
static |
Converts an int with the Multiselect attribute to a subset of a given list according to the int flags- converts the flag int to usable data.
| T | The eventType content of the list we're converting the flags to |
| _flags | The int with the Multiselect attribute- a flag int |
| _options | The list we're getting a subset of according to the flags |
Definition at line 82 of file MultiselectAttribute.cs.
|
static |
Shorthand for MultiselectAttribute.To<int>(_flags, _options). Useful for converting a multiselect to indexes in a list.
| _flags | The int with the Multiselect attribute |
Definition at line 118 of file MultiselectAttribute.cs.
Referenced by RyleRadio.Components.Base.RadioComponentDataAccessor.AssignToTracksGeneric(), and RyleRadio.Components.Base.RadioOutputTrackAccessor.DoTrackAction().
|
staticget |
A filler array with numbers 1 - 32. Not yet used, but theoretically helpful for indexing from the end of a list (list[^i] instead of list[i])
Definition at line 43 of file MultiselectAttribute.cs.
|
getprivate set |
Name of the variable this attribute uses for the options list.
Definition at line 26 of file MultiselectAttribute.cs.
Referenced by MultiselectAttribute().
|
staticget |
A filler array with numbers 0 - 31, used when converting from a flag int to a list subset.
Definition at line 31 of file MultiselectAttribute.cs.
Referenced by ToInt().