public static void DrawComponent(bool[] unfoldedComponents, string[] componentMemberSearch, IEntityExt entity, int index, IComponent component)
        {
            var componentType = component.GetType();
            var componentName = componentType.Name.RemoveComponentSuffix();

            if (EditorLayout.MatchesSearchString(componentName.ToLower(), componentNameSearchString.ToLower()))
            {
                var boxStyle = getColoredBoxStyle(entity, index);
                EditorGUILayout.BeginVertical(boxStyle);
                {
                    if (!Attribute.IsDefined(componentType, typeof(DontDrawComponentAttribute)))
                    {
                        var memberInfos = componentType.GetPublicMemberInfos();
                        EditorGUILayout.BeginHorizontal();
                        {
                            if (memberInfos.Count == 0)
                            {
                                EditorGUILayout.LabelField(componentName, EditorStyles.boldLabel);
                            }
                            else
                            {
                                unfoldedComponents[index] = EditorLayout.Foldout(unfoldedComponents[index], componentName, foldoutStyle);
                                if (unfoldedComponents[index])
                                {
                                    componentMemberSearch[index] = memberInfos.Count > 5
                                        ? EditorLayout.SearchTextField(componentMemberSearch[index])
                                        : string.Empty;
                                }
                            }

                            if (EditorLayout.MiniButton("-"))
                            {
                                entity.RemoveComponent(index);
                            }
                        }
                        EditorGUILayout.EndHorizontal();

                        if (unfoldedComponents[index])
                        {
                            var newComponent = entity.CreateComponent(index, componentType);
                            component.CopyPublicMemberValues(newComponent);

                            var changed         = false;
                            var componentDrawer = getComponentDrawer(componentType);
                            if (componentDrawer != null)
                            {
                                EditorGUI.BeginChangeCheck();
                                {
                                    componentDrawer.DrawComponent(newComponent);
                                }
                                changed = EditorGUI.EndChangeCheck();
                            }
                            else
                            {
                                foreach (var info in memberInfos)
                                {
                                    if (EditorLayout.MatchesSearchString(info.name.ToLower(), componentMemberSearch[index].ToLower()))
                                    {
                                        var memberValue = info.GetValue(newComponent);
                                        var memberType  = memberValue == null ? info.type : memberValue.GetType();
                                        if (DrawObjectMember(memberType, info.name, memberValue, newComponent, info.SetValue))
                                        {
                                            changed = true;
                                        }
                                    }
                                }
                            }

                            if (changed)
                            {
                                entity.ReplaceComponent(index, newComponent);
                            }
                            else
                            {
                                entity.GetComponentPool(index).Push(newComponent);
                            }
                        }
                    }
                    else
                    {
                        EditorGUILayout.LabelField(componentName, "[DontDrawComponent]", EditorStyles.boldLabel);
                    }
                }
                EditorLayout.EndVerticalBox();
            }
        }