- Home /
How to find component (for example: script) references/usages in prefabs?
I want to find out which prefabs reference or use a specific object. I have just purchased a new package and I want to understand some part of its code in order to make some modifications. But the code sends a message to a MonoBehavior that I cannot find any references to.
Of course I need to know whether there is some automated way to do that instead of inspecting all the prefabs manually :).
Answer by Tomer-Barkan · Oct 08, 2013 at 12:23 PM
First, are you sure the script is available in the package you purchased? It might only contain the binary files, if they don't want people to see/copy their code. Then you can't see the scripts whatever you do. You'll have to contact the package's creator to ask them for APIs or references of their scripts.
As for prefabs, you should see the scripts attached to them, or any other components, in the editor, just like any other object.
Answer by robinwood · Apr 07, 2016 at 11:01 PM
Yes, there is a way to find out where a particlular script is being used in prefabs.
Check it out here: https://www.assetstore.unity3d.com/#!/content/45693
Answer by Vandive · Apr 08, 2016 at 06:38 AM
Here is a simple script for you to use.
public BoxCollider col; // You Can Replace BoxColider With Any Component You Want
void Start () {
col = gameObject.GetComponent <BoxCollider> ();
}
void DoStuff () {
coll.size = new Vector3 (5, 5, 5); // Just An Example.
}