The Hierarchy window contains a list
of every GameObject in our current Scene.
GameObjects are listed in the Hierarchy window
in the order that they are added or created.
As GameObjects are added and removed from our Scene,
they will appear and disappear from the Hierarchy as well.
The Hierarchy lists our GameObjects in groups
known as Parents and Children.
The topmost GameObject or Scene is called the Parent,
or Parent Object.
And all GameObjects grouped underneath the Parent
are called Children, or Child Objects.
We can use the drop-down icon next to the name
of a Parent GameObject in the Hierarchy
to show its Children.
A Parent can have multiple Children.
GameObjects that share the same Parent
are known as Siblings.
Note that GameObjects can also have nested Parent-Child objects.
Nested Parent-Child objects are known as Descendants
of the top-level Parent.
We can re-order our GameObject in the Hierarchy
by dragging them up or down within the Hierarchy,
or by making them Child or Parent objects.
If a GameObject has no Parent,
its Transform properties are measured in world space.
If the GameObject is then moved in the Hierarchy
and made a Child of another GameObject,
its Transform properties are measured relatively
to the Transform of its Parent.
If we select a Parent GameObject and move it in the Scene view,
we can see that its Children are also affected by the transform.
This also applies to scale and rotation.
If we want to change the Transform of a single Child,
we can simply select the Child GameObject in the Hierarchy,
and adjust it accordingly.
At the top of the Hierarchy window is the Toolbar.
The Toolbar contains a Create menu button
for adding new GameObjects into our Scene,
and Search Bar to help find items in the Hierarchy window.
The Create menu button allows us to create new, empty GameObjects,
or pre-made objects for use in our Scene.
The Create menu button mirrors the first part
of the GameObject menu in the Menu Bar.
In this menu, we can choose to create an Empty GameObject,
3D GameObjects such as primitives, terrain and trees,
2D sprites, UI objects, and other pre-made GameObjects.
It is worth noting that it is possible to have more than one Scene open
in the Hierarchy window at any one time.
For more information on multi-scene editing,
see the information link below.
Next to the Create menu button is the Search Bar.
The Search Bar helps us easily identify GameObjects in our Scene,
and works in a similar way to the Search Bar
in the Scene view in the project window.
Searching for an item lists any GameObject
in the Hierarchy window,
whose name matches the search criteria.
Alternatively, we can search for any GameObject
that contains a Component whose type matches the search criteria.
It is worth noting that this search filters both the Hierarchy window
and the Scene view,
showing only the matching GameObjects in both windows.
If we select a GameObject from a search,
at the bottom of the Hierarchy window,
the nested path of the selected GameObject is listed.
If we cancel a search, the GameObject remains selected,
and its Parents are expanded, helping us to easily identify
that GameObject's location within the list.
As we can see, the Hierarchy view
lists all of the GameObjects in our Scene,
and allows us to organize and sort them with ease.