EntityExtensions.cs
EntityExtensions.cs
is a collection of extension methods enhancing the functionality of entities within the Stride game engine. These methods provide additional capabilities to entities, making it easier to work with them in various scenarios. From adding gizmos and interactive scripts to retrieving components and managing entity positions, these extensions offer a variety of useful tools for developers.
Here is an overview of the available extension methods:
Add2DCameraController()
- Adds an interactive 2D camera script to the specified entity, enabling camera movement and rotationAdd3DCameraController()
- Adds an interactive 3D camera script to the specified entity, enabling camera movement and rotationAddGizmo()
- Adds a TranslationGizmo to the specified entity with optional custom colorsGetComponent<T>()
- Retrieves the first component of the specified type from the entityGetComponents<T>()
- Retrieves all components of the specified type from the entityRemove()
- Removes the entity from its current scene by setting itsScene
property to nullTryGetComponent<T>()
- Tries to retrieve a component of type T from the given entityWorldPosition()
- An easier way to get world position
These extensions are designed to streamline common tasks associated with entities in Stride, enhancing the overall efficiency and flexibility of game development workflows.