Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by deus_duke · May 18, 2012 at 06:39 PM · editoreditor-scriptingeditorwindoweditorguieditor-classes

SearchableEditorWindow

Does anyone know where I can find information on SearchableEditorWindow? This class exists in the UnityEditor namespace, but there is no documentation on it. I am wanting to implement a searchable window with a search bar at the top like the hierarchy view, and it looks like this class would be the right place to start.

If not, is there a way to add the hierarchy view type search bar to the gui?

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image deus_duke · Jun 08, 2012 at 03:18 AM 0
Share

Hello thanks for getting back with me, I was wanting to create more thorough search filters for searching for scene items. The reason I was asking abou the class is that I thought there might be a member function in that class that gave the look of the search text field with the dropdown. I was creating a Unity Editor Extension called Super Search

avatar image Bunny83 · Jun 08, 2012 at 03:29 AM 1
Share

If you want to get more information about the classes that comes with Unity, i recommend ILSpy. It's a C# / IL reflector. Just open the UnityEngine and UnityEditor dll and explore. $$anonymous$$eep in $$anonymous$$d that alot stuff is internal or mapped to native code, but it helps to understand how certain things are implemented.

If you found a internal / private function / property which would be useful, you could use reflection to use it, but i wouldn't recommend it. Internal stuff can change at any time and isn't ment to be used from outside. It can cause a crash or strange behaviour.

avatar image deus_duke · Jun 08, 2012 at 03:34 AM 0
Share

Just realized I commented on my own question...

Anyway, thanks for the info!

avatar image Bunny83 · Jun 08, 2012 at 03:36 AM 0
Share

No, i've converted your answer to a comment since it wasn't an answer ;)

Anyway your super search looks good, however i don't need it, i have my own searching tool ;)

avatar image vexe · Sep 27, 2014 at 06:18 PM 0
Share

I agree with Bunny, ILSpy is a must. If you look in EditorStyles there's a lot of internal stuff that's worth reflecting and using including toolbarSearchField, ToolbarSearchField in EditorGUI and many more

2 Replies

· Add your reply
  • Sort: 
avatar image
7
Best Answer

Answer by EddyEpic · Jun 08, 2012 at 01:12 AM

You can add a search bar to the top by using:

 string searchString = "";
 void OnGUI()
 {
    GUILayout.BeginHorizontal(EditorStyles.toolbar);
    GUILayout.FlexibleSpace();
    searchString = GUILayout.TextField(searchString, EditorStyles.toolbarTextField);
    GUILayout.EndHorizontal();
 
    // Do comparison here. For example
    for (int i = 0; i < items.Length; i++)
    {
       if (items[i].name.Contains(searchString))
       {
          GUI.Label(items[i].name);
       }
    }
 }

where "items" is an array of UnityEngine.Objects.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by Bunny83 · Jun 08, 2012 at 03:13 AM

Yes and no. Searchable means the window is searchable. This class has a private static list which hold all references to all created windows that are derived from this type. It's actually meant as internal call as far as i can see. Most stuff is declared as internal and you have no way to actually search for an window since there is no public function for that.

Those windows are derived from SearchableEditorWindow:

  • SceneView

  • HierarchyWindow

  • ProjectWindow

The searchable has nothing to do with the hierarchy filter at the top (well there are internal function and fields, but only to hold the current used filter). It should be actually an internal class as well since it doesn't make much sense to derive a class from SearchableEditorWindow.

So you would have to create your own search / filter - field like @EddyEpic said. What exactly do you want to search / filter?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Show public GameObject prefab in EditorWindow 1 Answer

Thumbnails from assets in an EditorWindow 0 Answers

How to get EditorWindow client rect? 1 Answer

Member arrays not initialized in editor until after scripts are recompiled 1 Answer

Any way to attach a bit of code to individual UI Windows [Editor] 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges