FindMode EverythingInSelfAndChildren

book_4_sparkGenerated
code_blocksInput

Description

The EverythingInSelfAndChildren 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. The EverythingInSelfAndChildren value indicates that the search should include all components or game objects within the current object and its immediate children.

Usage

Use FindMode.EverythingInSelfAndChildren when you need to search for components or game objects that are located within the current object and its direct children. This is useful when you want to perform operations on a group of objects that are hierarchically related.

Example

// Example of using FindMode.EverythingInSelfAndChildren

// Assume 'gameObject' is a reference to a GameObject in the scene
var components = gameObject.FindComponents<SomeComponent>(FindMode.EverythingInSelfAndChildren);

// This will retrieve all instances of 'SomeComponent' in 'gameObject' and its children.