From Unity Reference :
// This will return the game object named Hand in the scene. hand = GameObject.Find("Hand"); You must remember that when trying to access objects via script, any inactive GameObjects are not included in the search. And that this will only return one object.
If you want to create the same behaviour as 'FindGameObjectsWithTag', you'll have to implement the function yourself.
In one of my games, for each level I used a GameObject to parent all the other objects, this way it was easier to access the objects. You could do something like :
int count = 0; GameObject[] children = GetComponentsInChildren<GameObject>(); foreach (GameObjectchild in children ) { if(children.name == "WantedName") ++count; } While this should work (from memory)Edit:
If you're using the UI to add instances to the spawner, that means that the spawner, and the objects it is supposed to spawn, are already instanced at startup. I would not recommenddon't think this is the best way to go about it. I would instead implementpersonally add a script that makes use ofto the messaging systemsspawner with an Enum for each monster type. This scripts behaviour would be to check if it holds an instance to an object, via SendMessageif not create one of the Enum type and keep the reference.
I'll need to get out Unity later and check, but this should workIf you haven't tried overloading UI yet, although I'm not sure exactly what it is you're trying to do ;)can be quite easy and help enormously in creating a more suitable editor for your game.