Description
The DisabledInSelfAndChildren
field is a member of the FindMode
enumeration in the Sandbox namespace. This enumeration is used to specify the mode of searching for components within a game object hierarchy. The DisabledInSelfAndChildren
mode specifically targets components that are disabled within the current game object and its immediate children.
Usage
Use the DisabledInSelfAndChildren
field when you need to find components that are not active in the current game object and its direct children. This can be useful for operations where you need to manipulate or inspect components that are not currently enabled.
Example
// Example of using FindMode.DisabledInSelfAndChildren
var components = gameObject.FindComponents<SomeComponent>(FindMode.DisabledInSelfAndChildren);
foreach (var component in components)
{
// Perform operations on each disabled component
component.DoSomething();
}