FindMode DisabledInSelf

book_4_sparkGenerated
code_blocksInput

Description

The DisabledInSelf field is a member of the FindMode enumeration in the Sandbox namespace. It is used to specify a search mode for components that are disabled within the current object itself. This enumeration is part of a set of flags that define how components or game objects are searched within a scene or hierarchy.

Usage

Use FindMode.DisabledInSelf when you need to search for components that are specifically disabled within the current game object. This can be useful when you want to perform operations only on components that are not active, such as for debugging or conditional logic based on component states.

Example

// Example of using FindMode.DisabledInSelf

// Assume 'gameObject' is an instance of a GameObject
var disabledComponents = gameObject.FindComponents( FindMode.DisabledInSelf );

foreach (var component in disabledComponents)
{
    // Perform operations on each disabled component
    // For example, logging or enabling them
    component.Enable();
}