FindMode EverythingInAncestors

robot_2Generated
code_blocksInput

Description

The EverythingInAncestors field is a member of the FindMode enumeration in the Sandbox API. It is used to specify a search mode that includes all components in the ancestor hierarchy of a GameObject. This includes the parent, grandparent, and all other ancestors up the hierarchy.

Usage

Use FindMode.EverythingInAncestors when you need to search for components across all ancestor GameObjects of a given GameObject. This can be useful when you want to apply operations or retrieve information from components that are not directly attached to the current GameObject but are part of its lineage.

Example

// Example of using FindMode.EverythingInAncestors
GameObject myObject = new GameObject();
var componentsInAncestors = myObject.FindComponents<SomeComponent>(FindMode.EverythingInAncestors);

// This will retrieve all components of type SomeComponent in the ancestors of myObject.