- Home /
Focus a file in Project Window
Hi,
In an EditorWindow, I'd like to focus a file in my project window.
I've found EditorUtility.FocusProjectWindow but it only give the focus to Project Window, not the file. I'd like to have the same behaviour as Object Picker's one: when I click on an Object Picker, the selected object is focus in yellow.
Is somebody ever try?
Thx
Comment
Answer by Gizmoi · Feb 08, 2013 at 05:12 PM
EditorGUIUtility.PingObject is what you're looking for. Pass in a GameObject and it'll highlight it yellow in the project view :)
Answer by HPx · Feb 08, 2013 at 05:30 PM
Thanks for your quick reply.
It works well.
I tried it before but I have been stopped by the object parameter. I finally get it with Resources.LoadAssetAtPath.
Thank you.