Instead of having each prefab keep track of all the other prefabs of the same name (which seems to be what you are trying to explain), you could use a single script to manage all prefab instances. Then manage a generic List and when you want to remove from there, you can use the unique identifier for each object/component in the scene that unity already has in GetInstanceID()
http://docs.unity3d.com/Documentation/ScriptReference/Object.GetInstanceID.html
I use this in a game im making now with enemy tanks being stored in a master list and when new ones are spawned, they get added to the list, and removed from the list when destroyed so that I can iterate on all active enemies.
If you do this, make sure you do gameObject.GetInstanceID() if you are storing game objects as just "GetInstanceID()" by itself will return the ID of the script component.
↧