Exemplo n.º 1
0
        //Types------------------------------------------------
        private void ShowTypeGUI()
        {
            ExtentionScrollPos = EditorGUILayout.BeginScrollView(ExtentionScrollPos, false, false, new GUILayoutOption[] { GUILayout.Width(_MainWindowWidth), GUILayout.Height(_MainWindowHeight - 50), GUILayout.MinWidth(_MainWindowWidth) });

            List <FilterType> toEdit = new List <FilterType>();

            foreach (var Type in LocalFilters)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(Type.FilterName, new GUILayoutOption[] { GUILayout.MaxWidth(100) });
                EditorGUILayout.LabelField(Type.GetExtentionAllowedList());
                if (GUILayout.Button("Edit"))
                {
                    MonoBehaviour.print("Extensiones Disponibles: " + LocalExtentions.Count);
                    EditType.OpenWindow(Type, Repaint, LocalExtentions);
                }
                GUI.backgroundColor = Color.red;
                if (GUILayout.Button("Remove Type"))
                {
                    FiltersToClear.Add(Type);
                }
                GUI.backgroundColor = Color.white;
                EditorGUILayout.EndHorizontal();
            }
            if (FiltersToClear.Count > 0)
            {
                ClearFilterList();
            }

            EditorGUILayout.EndScrollView();


            //Añadir types.
            EditorGUILayout.BeginHorizontal();

            NewTypeName = EditorGUILayout.TextArea(NewTypeName);
            //Mostrar todos los extentions y permitir seleccionarlos.
            if (GUILayout.Button("Add Type"))
            {
                LocalFilters.Add(new FilterType(NewTypeName, new List <string>()));
                NewTypeName     = DefaultTypeName;
                HasBeenModified = true;
            }

            EditorGUILayout.EndHorizontal();
        }
Exemplo n.º 2
0
 public ExtentionSelector(EditType InEdit, List <string> Extentions, bool[] Selections)
 {
     _OnEdit             = InEdit;
     _AviableExtentions  = Extentions;
     _ExtentionsSelected = Selections;
 }