IEnumerable<T> GetAllComponents()
IEnumerable<Component> GetAllComponents( System.Type type )

robot_2Generated
code_blocksInput

Description

The GetAllComponents<T> method in the Scene class retrieves all components of a specified type T within the scene. This method is generic and can be used to find components that implement a specific interface or are of a specific type. It only returns components that are currently enabled or active.

Usage

To use the GetAllComponents<T> method, you need to specify the type of component you are interested in. This method will return an enumerable collection of components of the specified type that are active in the scene.

Example usage:

Scene currentScene = ...; // Assume this is your current scene
foreach (var component in currentScene.GetAllComponents<MyComponentType>())
{
    // Perform operations with each component
}

Example

Scene currentScene = ...; // Assume this is your current scene
foreach (var component in currentScene.GetAllComponents<MyComponentType>())
{
    // Perform operations with each component
}