Example #1
0
 void SwitchTap(TapOpened tapToOpen)
 {
     tapOpened       = tapToOpen;
     nameOfNewObject = "";
     searchCriteria  = "";
     pathToNewAsset  = GetPath();
     SelectTextField();
 }
Example #2
0
    void OnGUI()
    {
        enterPressed = false;         //we do this here because the text fields later on will eat the event otherwise
        if (Event.current.keyCode == KeyCode.Return && Event.current.type == EventType.keyUp)
        {
            Event.current.Use();
            enterPressed = true;
        }
        EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
        if (GUILayout.Button("Search & Create", EditorStyles.toolbarButton))
        {
            tapOpened = TapOpened.Search;
        }
        if (GUILayout.Button("Help & About", EditorStyles.toolbarButton))
        {
            tapOpened = TapOpened.About;
        }
        EditorGUILayout.EndHorizontal();



        EditorGUILayout.BeginVertical();
        switch (tapOpened)
        {
        case TapOpened.Search:
            DrawSearch();
            break;

        case TapOpened.About:
            DrawAbout();
            break;

        case TapOpened.Create:
            DrawCreate();
            break;
        }
        EditorGUILayout.EndVertical();

        if (GUI.GetNameOfFocusedControl() == string.Empty)
        {
            SelectTextField();
        }
    }
 void SwitchTap(TapOpened tapToOpen)
 {
     tapOpened = tapToOpen;
     nameOfNewObject = "";
     searchCriteria = "";
     pathToNewAsset = GetPath();
     SelectTextField();
 }
    void OnGUI()
    {
        enterPressed = false; //we do this here because the text fields later on will eat the event otherwise
        if(Event.current.keyCode == KeyCode.Return && Event.current.type == EventType.keyUp)
        {
            Event.current.Use();
            enterPressed = true;
        }
        EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
            if(GUILayout.Button("Search & Create", EditorStyles.toolbarButton))
                tapOpened = TapOpened.Search;
            if(GUILayout.Button("Help & About", EditorStyles.toolbarButton))
                tapOpened = TapOpened.About;
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginVertical();
            switch(tapOpened)
            {
            case TapOpened.Search:
                DrawSearch();
                break;
            case TapOpened.About:
                DrawAbout();
                break;
            case TapOpened.Create:
                DrawCreate();
                break;
            }
        EditorGUILayout.EndVertical();

        if(GUI.GetNameOfFocusedControl() == string.Empty)
            SelectTextField();
    }
 void SwitchTap(TapOpened tapToOpen)
 {
     tapOpened = tapToOpen;
     nameOfNewObject = "";
     searchCriteria = "";
 }