public MultiselectDataSource(int mask, string[] displayedOptions, int[] flagValues) { m_DisplayNames = displayedOptions; m_FlagValues = flagValues; string buttonText; MaskFieldGUI.GetMenuOptions(mask, displayedOptions, flagValues, out buttonText, out m_OptionNames, out m_OptionMaskValues, out m_SelectedOptions); }
public void UpdateSelectedId(AdvancedDropdownItem item) { m_Mask = m_OptionMaskValues[item.elementIndex]; MaskFieldGUI.GetMenuOptions(m_Mask, m_DisplayNames, m_FlagValues, out var buttonText, out var buttonTextMixed, out m_OptionNames, out m_OptionMaskValues, out m_SelectedOptions); if (enumFlags != null) { m_EnumFlag = EnumDataUtility.IntToEnumFlags(enumFlags.GetType(), m_Mask); } RebuildSelection(root); }
public override void UpdateSelectedId(AdvancedDropdownItem item) { m_Mask = m_OptionMaskValues[item.m_Index]; string buttonText; MaskFieldGUI.GetMenuOptions(m_Mask, m_DisplayNames, m_FlagValues, out buttonText, out m_OptionNames, out m_OptionMaskValues, out m_SelectedOptions); if (enumFlags != null) { m_EnumFlag = EditorGUI.IntToEnumFlags(enumFlags.GetType(), m_Mask); } RebuildSelection(); }
public MultiselectDataSource(Enum enumValue) { m_EnumFlag = enumValue; var enumType = enumFlags.GetType(); var enumData = EnumDataUtility.GetCachedEnumData(enumType); if (!enumData.serializable) { // this is the same message used in SerializedPropertyEnumHelper.cpp throw new NotSupportedException(string.Format("Unsupported enum base type for {0}", enumType.Name)); } m_Mask = EnumDataUtility.EnumFlagsToInt(enumData, enumFlags); m_DisplayNames = enumData.displayNames; m_FlagValues = enumData.flagValues; MaskFieldGUI.GetMenuOptions(m_Mask, m_DisplayNames, m_FlagValues, out var buttonText, out var buttonTextMixed, out m_OptionNames, out m_OptionMaskValues, out m_SelectedOptions); }