FindMode EverythingInDescendants

book_4_sparkGenerated
code_blocksInput

Description

The EverythingInDescendants field is a member of the FindMode enumeration in the Sandbox API. It is used to specify a search mode that includes all components within the descendants of a GameObject. This means it will search through all child objects, their children, and so on, recursively.

Usage

Use FindMode.EverythingInDescendants when you need to retrieve all components from a GameObject's entire hierarchy of descendants. This is particularly useful when you want to perform operations on all components within a complex object structure.

Example

// Example of using FindMode.EverythingInDescendants
GameObject myObject = new GameObject();
var components = myObject.FindComponents( FindMode.EverythingInDescendants );

foreach (var component in components)
{
    // Perform operations on each component
    component.DoSomething();
}