Description
The EverythingInSelfAndDescendants
field is a member of the FindMode
enumeration in the Sandbox namespace. This enumeration is used to specify the scope of a search operation for components or game objects within a scene hierarchy.
The EverythingInSelfAndDescendants
value indicates that the search should include all components or game objects within the current object and all of its descendants. This means that the search will traverse the entire subtree starting from the current object, including all children, grandchildren, and so on.
Usage
Use FindMode.EverythingInSelfAndDescendants
when you need to perform a comprehensive search that includes the current object and all of its descendants. This is particularly useful when you want to ensure that no component or game object within the subtree is missed.
To use this enumeration value, you typically pass it as a parameter to a method that performs a search operation, such as finding components or game objects within a scene.
Example
// Example of using FindMode.EverythingInSelfAndDescendants
// Assume 'gameObject' is a reference to a GameObject in the scene
var components = gameObject.FindComponents( FindMode.EverythingInSelfAndDescendants );
// This will return all components in the current GameObject and all its descendants.