FindMode EnabledInSelf

book_4_sparkGenerated
code_blocksInput

Description

The EnabledInSelf field is a member of the FindMode enumeration in the Sandbox API. It is used to specify a search mode for components that are enabled within the current object itself. This enumeration is part of a set of flags that define various scopes and conditions for finding components in a scene or game object hierarchy.

Usage

Use FindMode.EnabledInSelf when you need to search for components that are enabled and are directly attached to the current game object. This is useful when you want to limit your search to only the components that are active and part of the current object, without considering its children or parent objects.

Example

// Example of using FindMode.EnabledInSelf
var components = gameObject.FindComponents<SomeComponent>(FindMode.EnabledInSelf);

// This will return all enabled components of type SomeComponent that are directly attached to gameObject.