Is it possible to find ALL game objects containing the same script in my project, or does anyone know of a pug in ?
The reason I ask is over the years if created so many scripts and I’m sure some of them now are not needed or used by any game object so would like to delete them because I’m on a quest to clean up my project.
You can use the Static function FindObjectsOfType from the class Object. This finds only objects in the Scene basically, or did you want a way to find prefabs which use the script as well?
Thanks for the reply, I'm looking to search through my project, scene, Asset folder and it's hierarchy, my project not just my scene as I might have a game object in a folder using the script but not yet placed in the scene.
Actually now that I think of it you could put a Debug.Log in Awake that provides you with a pointer to the object. Its not a bullet proof solution by any means, but it will tell you if any GameObjects currently in use need the script.
Yeah but I'm looking to search through my project, scene, Asset folder and it's hierarchy, my project not just my scene as I might have a game object in a folder using the script but not yet placed in the scene. Think GameVortex link above is the answer ..
Thanks for the reply, I'm looking to search through my project, scene, Asset folder and it's hierarchy, my project not just my scene as I might have a game object in a folder using the script but not yet placed in the scene.
– GriffoThats what I needed, thank you, please convert your comment to an answer so I can except it.
– GriffoConverted Comment to Answer
– GameVortex