Creating Search Windows in the Unity Editor

Sdílet
Vložit
  • čas přidán 28. 08. 2024
  • Long dropdown lists in the Unity Editor are painful. Let's improve them, by converting them to Searchable Windows instead! 🔎
    --------------------------------------------------------------------------------
    Want to support the channel?
    ▶️ Help fund new episodes by joining the Patreon - / gamedevguide
    Use these links to grab some cool assets from the asset store:
    Get the Must Have Assets! - assetstore.uni...
    Free Unity Assets! - assetstore.uni...
    New on the Asset Store! - assetstore.uni...
    Top Paid Asset Store Packages - assetstore.uni...
    Asset Store Partners - assetstore.uni...
    --------------------------------------------------------------------------------
    Socials and Other Stuff:
    • Subscribe - www.youtube.co...
    • Join the Discord - / discord
    • Twitter - / gamedevguideyt
    • Facebook - / gamedevguideyt
    • Instagram - / gamedevguideyt

Komentáře • 42

  • @GameDevGuide
    @GameDevGuide  Před 2 lety +3

    👚 🛒Get 15% off all orders over $35 on the merch store until March 1st 2022 - www.gamedevguide.store

    • @getemratan6516
      @getemratan6516 Před 2 lety

      Can we add
      Custom Script Templates to Add Component context menu just like New Script option over there?
      Would be more convenient instead of right clicking in the project window and creating the custom script

  • @yaboiskner
    @yaboiskner Před rokem +3

    To get the type of the Attribute you're using, the PropertyDrawer already has a field called 'attribute', which means you can access the instance of the custom PropertyAttribute class which can then be used to get the type.

  • @decelerisgames8276
    @decelerisgames8276 Před 2 lety +1

    Since I'm using Odin Inspector, I haven't once had to ask myself the question on how to improve the inspector. I mean, if the unity dev team try to make a big game with their software, they're gonna probably end up using it. Seriously, this is a life saver. Until you are working on a complexe plugin like the new Input System or Doozy UI editor windows, you can all the basic stuff easily

  • @MalbersAnimations
    @MalbersAnimations Před 2 lety +1

    And just like that!, I have turned on the little bell on this channel "🔔" Thank you, from the bottom of my heart! 🙏

  • @Andrew90046zero
    @Andrew90046zero Před 2 lety +2

    *Unity Creates Something Useful*: "Welp, this is only for us, so let's keep it secret and hide it in an experiemental namespace"

  • @Edvinas01
    @Edvinas01 Před 2 lety +3

    Right on time! Exactly what I needed for my custom library. Thank you for sharing this.

  • @_g_r_m_
    @_g_r_m_ Před 2 lety +1

    This man is covering the indie features before they turn mainstream

  • @TheOrment
    @TheOrment Před 2 lety +2

    great vid!
    in newer versions of unity (2021+) you can use the "quick search" window as the asset browser for Unity.Object types too, it has its pros and cons but I believe it's worth mentioning

  • @Andrew90046zero
    @Andrew90046zero Před 2 lety

    I'm not really in the need of a "mini search dropdown" at the moment, but I'm still glad I found this video!
    I've been looking for a video showing different ways to use Unity's newer Search system; the one that has it's own special window. There are barely any resources I can find on syntax for things doing various things. There is some info in the unity docs, but not many examples.

  • @fluffygamedev
    @fluffygamedev Před 2 lety

    This is awesome! 😮
    I've been wanting Search Windows for a long time.
    Turns out they were just hidden in an obscure place.

  • @dpeter99
    @dpeter99 Před 2 lety +12

    I'm quite confised by the fact that Unity seams to try to write new stuff with UiToolkit. But there aren't any tutorials for unig it in the editor for more adavanced stuff, and the docs are lacking.
    I'm looking forward to more editor tooling stuff, especially the graph as it is a topic that doesn't have that many tutorials.

    • @AxWarhawk
      @AxWarhawk Před 2 lety +1

      I once asked an experienced gamedev who uses Unity on a daily basis where the document for the editor UI stuff is. Her answer was that there pretty much isn't any documentation and that you just use the (decompiled) source code to figure things out. Looking at her perplexed I asked: okay then, but this probably isn't stable. How often does the Unity (editor) plugin break? 'Every other release', she confessed.

  • @zojirushi1
    @zojirushi1 Před rokem

    This is some top tier game dev content!! 👀

  • @bensulzinsky4225
    @bensulzinsky4225 Před 2 lety +8

    This is phenomenal. I'm going to integrate that SO searcher into a project of mine right away. One thing I don't understand -- why go with the GetPropertyAttribute extension method over the "attribute" property of the PropertyDrawer class? As in: ( attribute as SearchObjectAttribute ).searchObjectType;
    I can definitely see the utility of the extension method for retrieving attributes of other types -- just wondering if there's something else that I'm missing. Thanks again for this terrific video.

    • @GameDevGuide
      @GameDevGuide  Před 2 lety +5

      I straight up just didn't know you could do that, so thanks. 😂🙈 At least you have a useful extension method for elsewhere!

  • @simoncodrington
    @simoncodrington Před 2 lety

    Ooo another great video. Always watch these when they pop up

  • @mrx10001
    @mrx10001 Před 2 lety +5

    wish you posted the code in a downloadable unity package or something, re-typing the code as seen on screen for learning purposes, is a pain.

  • @RichardTongeman
    @RichardTongeman Před rokem

    Mesh graph looks awesome!

  • @BarcelonaMove
    @BarcelonaMove Před 2 lety

    This is so good, you should definitely be working directly at Unity itself.

  • @nabeelahmedsiddiqui8
    @nabeelahmedsiddiqui8 Před 2 lety +2

    Man you're a Master!!!

  • @SaiponathGames
    @SaiponathGames Před 2 lety +3

    Really cool, good job, even though I use Godot, this video is still a little bit helpful for me as a game dev! Please do make more videos on concept of game dev that applies to all game engines though, it might be helpful really.

  • @AndersonMarquesss
    @AndersonMarquesss Před 2 lety

    This is really useful, thanks for share with us.

  • @odo432
    @odo432 Před 2 lety +2

    This is probably where assets like Odin Inspector would come in handy. But it can be quite costly for those with minimal money to spend so it's always nice to be able to do these things yourself. Good video.

  • @zeroxinfinity3718
    @zeroxinfinity3718 Před 2 lety +1

    Excellent Work

  • @LuizMoratelli
    @LuizMoratelli Před rokem

    Did you already uploaded the video about graphviews?

  • @MaZyYTube
    @MaZyYTube Před 2 lety

    Omg nice, I was looking for this long time. I have a custom editor where I look for generic types. Unity does not show it.. it shows the parent. So I decided to make own list with the generic type scriptableobjects but I am using popup. Later I wanted to add own search window. I more look for the Asset search list but this is also enough. Very good.

  • @marten4story93
    @marten4story93 Před měsícem

    Please tell when you need to add using tags for the things you use in code

  • @MaraldBes
    @MaraldBes Před 2 lety

    I’ll probably have to watch this another 100 times before I can sort of understand it, but hopefully it is possible to use this on unity events as well. When I want to invoke some action using unity events and call to another class some lists of functions are so long that I have trouble finding the function I want to reference.

  • @322ss
    @322ss Před 2 lety

    Really neat! Thanks!

  • @ShiNijuuAKL
    @ShiNijuuAKL Před 2 lety

    I actually clicked this video just because I like your videos and not because I was particularly interested in this particular topic

  • @WebMonkey741
    @WebMonkey741 Před 2 lety

    Hey Game Dev Guide! Great video! Thanks so much for putting this together! I've been playing around with my own version of your code and I noticed something in your video at 8:14. You select Fish --> Assorted in your search window list. Assorted shows up in your drop down control as you would expect. But when you then RECLICK your popup editor to retrigger your search window, your window is reset and you are put back to the top of your item heirarchy. If you had a fairly extensive heirarchy, (or in my case of a very long list of search tree entries) then it might be helpful to open the search window with the previous option automatically selected. In this way you wouldn't need to renavigate the options if you just wanted to select another leaf in the same grouping.
    Do you know if this is possible with the Search Window editor? Of course with the first / null option you could just default to the top entry like before, but it would seem to me that this would be very useful behaviour for the Search Window editor control.
    Thanks again!

  • @FyresGames
    @FyresGames Před 2 lety

    Hey great tutorial. How could it be used for the Animation window Event dropdown list?

  • @brandonanderson8663
    @brandonanderson8663 Před rokem

    It would be better if you stored the path in the userData instead of creating an object for every option. Than you can use this line to get the object on the OnSelectEntity method:
    var obj = AssetDatabase.LoadAssetAtPath((string)searchTreeEntry.userData);

  • @SomeBodyThatYouUsedToKnow303

    Can you, please, make tutorial on how to make custom editor that can hide variables in inspector according to other variables' value?

  • @christiangandha
    @christiangandha Před 2 lety

    I need help, I have follow the Tutorial until 6:30, but I got an error when I call SearchWindow.Open() it said NullReferenceException and the window isn't opening. The difference is that I use ScriptableObject.CreateInstance instead of new StringListSearchProvider (I tried using this and it still throws an error + a warning saying that I need to create ScriptableObject not new) and in the SearchTreeEntry, there isn't a second parameter to input the integer. I'm using Unity 2020.3.17f1. Thanks

  • @Vastlee
    @Vastlee Před 2 lety

    Great video, but the tag sticking out during your merch ad is going to ruin my entire OCD day!!!

  • @tkg__
    @tkg__ Před 2 lety

    Why isn't Unity using this for the GameObject->Create dropdown? WTF, Unity.

  • @SubjektDelta
    @SubjektDelta Před 2 lety

    just buy ODIN lmao

  • @FerdinandJosephFernandez

    That's interesting. There's a class called AdvancedDropdown that does the same thing, but isn't in an experimental namespace (it's in UnityEditor.IMGUI.Controls). And it's been there since Unity 2019.1 I believe. Code is different but works in a similar way. For example, it has a BuildRoot method instead of a CreateSearchTree.

  • @prosfaction
    @prosfaction Před 2 lety

    Thanks for helpful video about Search Window, but when you are inside the PropertyDrawer class you can you use fieldInfo.GetCustomAttribute() to get attribute of the field, so you don't need to write that huge function to GetCustomAttribute.