This line give me first time only one result if in the Hierarchy i have a Plane object that it’s name is Plane.
List<GameObject> planes = (from g in UnityEngine.Object.FindObjectsOfType<GameObject>() where g.name.Equals(planeName) select g).ToList();
But i have in the Hierarchy also Planes named: Plane (3) and Plane (4) and Plane (1) so it’s not in the List. How can i List any object that contain the name Plane so also objects with the name Plane or Plane (23) will be listed ?
Second question i have is how do i know if object is really type of Plane ?
When i’m looking at Plane Inspector i can see the name Plane or Plane12 but who said it’s Plane and not a Cube that renamed to Plane12 ? I mean if i want to List only objects that are type of Plane not by name but by type ? And how can i check alone in the editor not in a script and identify that the object is really plane and not cube or Sphere ?