Hi! I create objects by using Prefab at script CarScriptCreate.cs. Prefab called CarPrefabType1.
At another Script I want to tind all cars which has created by CarScriptCreate.cs.
I tryed to do this:
public CarPrefabType1 car1_object;
private CarPrefabType1 [] carObjects;
// Use this for initialization
void Start ()
{
carObjects= FindObjectsOfType(typeof(CarPrefabType1 ));
}
But I can’t drag prefab into field CarPrefabType1 in the inspector because it isn’t shown. I don’t know why unity dont show this field. Compieler only writes that it doesn’t know this type. But I can’t attach this prefab to this script. I doing somethis wrong.
Please, tell me how I can find all objects which have created by another script by using Instantiate function.