Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Can we get a back button in the project panel?

Discussion in 'Editor & General Support' started by MadeFromPolygons, Aug 7, 2019.

  1. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,952
    Title says it all, my biggest pet peeve from using unity 8 hours a day 5 days a week and about 3-4 hours a day at weekends is that there is no way to go "back" in the project panel. This is fine if you are in the same folder structure as you can use the breadcrumb to go back, but if you jump to a different folder altogether you get no way to go back to where you were in a single click.

    In a big project with many folders it means you are scrolling through folders and collapsing / expanding until you find the right one again, and just feels archaic in a 2019 application.


    So can we please get a back button? One that actually takes us back to last folder project panel was in.

    I am pretty sure I could write an editor extension to do this but it feels like everyone would benefit from this.
     
  2. ctedin187

    ctedin187

    Joined:
    Aug 20, 2018
    Posts:
    11
    I would love this. I keep trying to hit it every time, but find it missing. Anyone try this asset on the Unity store? I'd hate to add it to a group project though. I'd break it, I'm sure.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    A couple times a week I find myself looking for this back button, only to again remember no it doesn't exist. Every few days rinse/repeat.
     
    Vryken and PraetorBlue like this.
  4. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,851
    Yes! Yes please!
     
    Vryken and Joe-Censored like this.
  5. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    While we're at it, copy/cut/paste as well please.
     
    Joe-Censored likes this.
  6. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    Inspired by this post..

    AssetSelectionHistory_2019_4_8f1.jpg AssetSelectionHistory_2020_2_0a19.jpg

    To open the window, look under the Tools menu. Dock the Asset Selection History above Project Window / wherever.
    AssetSelectionHistory_HowToOpen.jpg

    Tested in 2019.4.8f1 and 2020.2.0a19.

    The checkmark clears the History and adds whatever's currently selected.

    Edit: 2020-08-20, unitypackage attached to this post updated to latest version.
    Edit: same day, again, to 1.0.2.. see later in the thread or changelog in source.
     

    Attached Files:

    Last edited: Aug 21, 2020
  7. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    There are some deficiencies I've noticed:

    Persistence. I've already solved this and now have the history saved to EditorPrefs, silently restored as necessary. History was being lost when entering Play Mode or restarting the Editor. The references are now stored and restored by their GUIDs.

    Duplicates. If you select something that already exists in the list and it wasn't the previous selection, it will add it again - so selecting PrefabA, then PrefabB, and then selecting PrefabA again will have created 3 items in the history. I want this to just change the item selected in the dropdown to the matching selection so you can toggle between things like usual without any clutter.

    I'll probably do the second thing today ..maybe more, then I'll post the update :)
     
  8. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    Code (CSharp):
    1. /*
    2. 2020-08-20 - 1.0.1
    3.  
    4. - Fixed
    5.   - Entering Play Mode would result in the History being lost.
    6.  
    7. - Added
    8.   - History is now saved to EditorPrefs and restored when reopening Unity or as necessary.
    9.   - Ability to reselect the indicated selection (i.e. for after deselection).
    10.   - Ability to remove current selection from the list.
    11.  
    12. - Changed
    13.   - The button that previously was used to clear the history now opens a menu.
    14.   - Selecting the same objects as a selection already added to history will
    15.     now re-select that in the list instead of adding a duplicate, up to LIMIT_DUPLICATES
    16.     number of most recent selections, or 0 (allow), -1 (check all).
    17.     - By default, this only checks for duplicates in the 100 most recent selections.
    18. */
    Edit: I didn't consider multiple projects - it's an easyish fix, just have to change "ash" to be something like ("ash_" + unique_project_string),
    Code (CSharp):
    1.   void SaveHistory()
    2.   {
    3.     EditorPrefs.SetString("ash", string.Join<string>("?", guidsEncoded));
    4.   }
    5.   void LoadHistory()
    6.   {
    7.     string value = EditorPrefs.GetString("ash", "");
    8. [...]
    I'll try to figure out where to get the unique identifier, unless someone who knows can tell me first :)

    Edit: Solved. Replace the two occurances of
    "ash"
    with
    "ash_" + Application.dataPath


    Edit: Updated attachment to latest version, 1.0.2
    Code (CSharp):
    1. /*
    2.   2020-08-20 - 1.0.2
    3.  
    4.   - Fixed
    5.     - Different projects would use the same history.
    6. */
     

    Attached Files:

    Last edited: Aug 21, 2020
    EAST-DATA, Ksanone, ununion and 2 others like this.
  9. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    great,but the window height has some problem,that is too tall,in 2021 lts
     
  10. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,548
    has another problem in newer engine versions too - at some point there started to be submenus in the history dropdown as well for some combinations of selections, haven't tested in ages and may be other things that don't work as before, but of course feel free to modify however. I did this quick like 2.5 years ago in the span of a day or two but plenty of room for cleanup/improvement. If anyone wants to update or maintain it and [hopefully] share with everyone please do :)
     
  11. unity_eBK7N4vuWJw5VQ

    unity_eBK7N4vuWJw5VQ

    Joined:
    Jul 21, 2021
    Posts:
    5
    the fact that there's no back button by default, blows my mind
     
  12. jay3sh

    jay3sh

    Joined:
    Dec 30, 2013
    Posts:
    19
    This little utility is golden. Great job @adamgolden ! Bummer that Unity doesn't add this by default.
     
    adamgolden likes this.