Description
The Enabled
field of the FindMode
enumeration is used to specify that only components which are currently enabled should be considered during a search operation. This is particularly useful when you want to filter out components that are not active or are disabled, ensuring that only operational components are returned.
Usage
Use the FindMode.Enabled
flag when you need to search for components that are currently active and enabled. This can be combined with other FindMode
flags to refine your search criteria further.
Example
// Example of using FindMode.Enabled to find enabled components
var enabledComponents = gameObject.FindComponents<Component>(FindMode.Enabled);
// This will return all enabled components attached to the gameObject.