FindMode EverythingInSelfAndAncestors

book_4_sparkGenerated
code_blocksInput

Description

The EverythingInSelfAndAncestors field is a member of the FindMode enumeration in the Sandbox API. This enumeration is used to specify the scope of a search operation for components within a game object hierarchy. The EverythingInSelfAndAncestors value indicates that the search should include all components within the current game object and all of its ancestor objects.

Usage

Use FindMode.EverythingInSelfAndAncestors when you need to search for components in the current game object and all of its parent objects up the hierarchy. This is useful when you want to ensure that you are considering all possible components that might affect or be affected by the current object, including those in its parent objects.

Example

// Example of using FindMode.EverythingInSelfAndAncestors

// Assume 'gameObject' is an instance of GameObject
var components = gameObject.FindComponents<SomeComponentType>(FindMode.EverythingInSelfAndAncestors);

// This will search for 'SomeComponentType' in the current game object and all its ancestors.