Hi, How to call the Asset selector window (see screenshots) from an editor script? This window shows up for example when clicking on "select" in a material component. Thanks.
Your question seems a bit vague. Can you provide a code example of what you're trying to do? If you're just trying to assign a different texture to a material in code, there's no need to open the asset selector window. You would just use GetComponent<Material>() to get the material and call SetTexture().
I would like to select an asset (model) which is in the project view from a GUI. I wonder if there is a function similar to EditorUtility.OpenFilePanel() that displays the asset of a particular type (Texture, Model, etc.). For example, when you click on "select" (see screenshot above) on a texture, a selection window appears. I wonder how to call this window from a script.
Check the docs for EditorGUI and EditorGUILayout. I haven't done much editor scripting recently, but there should be a control there that will allow you to select an asset of a specified type.
I was just looking for the exact same thing, and I prefer it when the actual answer is given in the forum thread, so here it is: You specificially want the ObjectField method. To use it with a Texture, you would do the following Code (csharp): myTexture = (Texture2D)EditorGUILayout.ObjectField("My Texture", myTexture, typeof(Texture2D), false);