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.
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.
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 of accessing the Components property public class MyComponent : Component { public void PrintComponentNames() { foreach (var component in Components) { Log.Info($"Component: {component.GetType().Name}"); } } }