- Home /
UI vs Scripts question - what's where?
As my collection of scripts grows in my (first) Unity (iPhone) project, I'm forced to wonder:
1) is there any way in the UI to see what objects the scripts are attached to? I know it goes the other way, but I want something like: highlight script and see what objects use it. (Yes, I know I can do a print(name), but that's not what I'm after. I really almost expected to be able to control-click a script and see this information.)
2) is there a way to find a function (OK: any text) across all scripts? (ie: which script holds function doThis(); ?
With my luck, I may have missed where all this is covered. If so, please point me at the proper docs.
Thankfully, noob-ness doesn't last forever. :-)
TIA
a big +1 for your 1) - I miss that functionality all the time. Not only for Scripts, but also for $$anonymous$$aterials, and other assets. I seem to remember there is some sophisticated Editor plugin, and your request is just one of its $$anonymous$$or features. Unfortunately I don't remember which plugin that is. #2 might be more complicated. I generally help myself by installing cygwin, and doing a find-grep over all scripts :o) grep is an incredibly useful UNIX/Linux tool - if you are using OSX you are lucky, as it should already be available to you when you open a ter$$anonymous$$al/shell.
Answer by fherbst · Aug 12, 2010 at 11:11 PM
As to 1) - part (if not all) of this comes with Unity3: http://blogs.unity3d.com/2010/06/15/unity-3-feature-preview-asset-management/
As to 2) - As Wolfram mentioned, I would use an external tool to search in multiple files. For Windows, I can recommend Notepad++. Since Unity2.6 it can be connected with Microsoft Visual Studio, too.
Answer by Julian-Glenn · Aug 13, 2010 at 01:03 AM
No. 2.)
Not sure about Mac but on a Windows box the UniSciTE editor has a Find in Files function built in.
Choose : Search >> Find In Files. or Ctrl + Shift + F
Answer by MattMaker · Aug 31, 2011 at 12:30 AM
I have been wanting this (a "reverse dependency" finder; a "What uses this asset?" function) also, and I haven't found any other solution that does exactly what I want, so I wrote this editor script to do it: http://unifycommunity.com/wiki/index.php?title=UnityAssetXrefs
drop it in your "Editor" folder; it should add a "What objects use this?" command to your Assets menu. (I have an update coming soon that will add a progress bar to it.)
Your answer
Follow this Question
Related Questions
Script work in editor but not in build 0 Answers
Editor: Force Hand tool 2 Answers
GUI Remove focus from an editor text field when clicking elsewhere. 2 Answers
Button Turns Off and On Object 1 Answer