Probably A Question For The More Advanced Unity Users

Here is my problem:
Each scene/level in my projects contains several game objects named “Collectible”.
Each Collectible game oject has a CollectibleControler.cs script attached to it.
Accidentally I deleted this script. I recovered the script file, but now all the game objects have lost the conecion to this script and show the missing script warning in the editor.

Is there a way to reestablish the conection of the game objects to the script without going manually througt hundreds of objects?

So i guess what i need is a function which goes like:
in all scenes iterate through all gameobjects called Collectible and replace the missing script component with the CollectibleControler.cs

Is this possible?

How many scenes do you have?

If all the objects are listed together in a scene (they should be as they are in alphabetical order, unless you have them in folders), just highlight the them all and fix them in one go. It should not take too long unless you have several hundred scenes. You do not have to work on each object individually if you are doing the same thing to them.

thanks moon jump, thats what i´m going to do.
with 60 levels i wont take too long, but i think it is very likely that i will miss a level or two.
but with the help of the FindMissingScript that i just found this not should be a huge problem…

write editor script that adds the component to all objects alled collectible

I’ve ran into this problem before at the worst of times:)

This guy is super smart he has s way to rebind the scripts you might want to check it out.

http://unitygems.com/lateral1/

If you had .META files turned on for source control, you’d be able to manually edit the GUID of your re-added script file so that it matched the old GUID.