if (string.IsNullOrEmpty(planeName))
{
planeName = "Plane";
}
List<GameObject> planes = (from g in UnityEngine.Object.FindObjectsOfType<GameObject>() where g.name.Equals(planeName) select g).ToList();
This will list 0 planes since all the Planes in my Hierarchy names are: Plane (3) , Plane (4) , Plane (3)
I have 3 Planes but the names are not Plane but with numbers and ( )
What i want to get in the List is all the Planes either name only Plane or with numbers like Plane (3)
And is there any way also to List only gameobjects that are type Plane ? I can put a cube in my Heirarchy and name it Plane(7) so it will count in the List as Plane but it’s cube.
So the List planes should contain all objects that contain the name Plane but also to check that each object name Plane is also type of Plane not only containing the name.