ComponentList Components { get; set; }

robot_2Generated
code_blocksInput

Description

The Components property provides access to the list of components attached to the GameObject that this Component is part of. This allows you to interact with other components on the same GameObject easily.

Usage

Use the Components property to retrieve and manipulate other components attached to the same GameObject. This can be useful for coordinating behavior between components or accessing shared data.

Example

// Example of accessing the Components property
public class MyComponent : Component
{
    public void PrintComponentNames()
    {
        foreach (var component in Components)
        {
            Log.Info($"Component: {component.GetType().Name}");
        }
    }
}