void SetValue(int index, bool value) { if (index == 0) { // None was selected so we reset all the bits to false m_Field.SetValue(System.Enum.ToObject(m_Field.enumType, 0)); foreach (var toggle in toggles) { if (toggle.getter != null) { toggle.UpdateValueLabel(); } } } else { int intValue = System.Convert.ToInt32(m_Field.GetValue()); if (value) { intValue |= m_Field.enumValues[index]; } else { intValue &= ~m_Field.enumValues[index]; } m_Field.SetValue(System.Enum.ToObject(m_Field.enumType, intValue)); } }
void SetValue(int index, bool value) { if (index == 0) { // None was selected so we reset all the bits to false m_Field.SetValue(System.Enum.ToObject(m_Field.enumType, 0)); } else { int intValue = System.Convert.ToInt32(m_Field.GetValue()); if (value) { intValue |= m_Field.enumValues[index]; } else { intValue &= ~m_Field.enumValues[index]; } m_Field.SetValue(System.Enum.ToObject(m_Field.enumType, intValue)); } }
void SetValue(int index, bool value) { int intValue = System.Convert.ToInt32(m_Field.GetValue()); if (value) { intValue |= m_Field.enumValues[index]; } else { intValue &= ~m_Field.enumValues[index]; } m_Field.SetValue(System.Enum.ToObject(m_Field.enumType, intValue)); }