private void AddTypesToMenu(Grouping typeGrouping)
        {
            var types = GetFilteredTypes();

            AddIncludedTypes(types);

            foreach (var nameTypePair in types)
            {
                string menuLabel = TypeNameFormatter.Format(nameTypePair.Value, typeGrouping);
                AddLabelIfNotEmpty(menuLabel, nameTypePair.Value);
            }
        }
Beispiel #2
0
        public void Draw(Rect position)
        {
            _menu = new GenericMenu();

            AddNoneElementIfNotExcluded();

            var classGrouping = _constraints?.Grouping ?? ClassTypeConstraintAttribute.DefaultGrouping;

            foreach (var type in GetFilteredTypes())
            {
                var menuLabel = TypeNameFormatter.Format(type, classGrouping);
                AddLabelIfNotEmpty(menuLabel, type);
            }

            _menu.DropDown(position);
        }