- Home /
Browse where all scripts are relative to gameobject reference
Is it possible to browse where all the scripts are in a project relative to the gameobject that contains them - i.e., which game object has which scripts etc?
Is it also possible to find out which gameobjects reference which scripts that are not actually placed in the gameobject?
For the second paragraph: Do you mean like figuring out if a script access another script via GetComponent or something? Or just a public reference?
Yes, both GetComponent or referenced as a global - or just called as a static - basically all the cases a gameobject can reference/call another script
It's impossible to tell for sure since GetComponent accept a string argument which can be generated/selected at run-time. But that is a very special scenario. Because Unity allow for reflection, it's quite hard to decide by automated means which files are in use and which ain't, since the files could be deferred to at a later point in time. But if you have all types as references, you could make write an editor script that would parse all public members and try to match them with source files. I haven't been toying around too much with the different ways of deter$$anonymous$$ing dependencies between scripts in the editor, so maybe there are tools that can help you already.
Hmm what about just a way to browse which game objects contains which scripts then? (Ignoring the second part for the in-line GetComp references)