Hi,
Let's say you want to access only the gameobjects that you have in your scrpit (e.g script name is DemoScript). To access only these game objects, try this:
object[] obj = GameObject.FindObjectsofType(typeof(DemoScript));
foreach(object o in obj)
{
//do something
}
Hope this helps.
↧