Class WorldExtensions
- Namespace
- RisingV.Core.Extensions
- Assembly
- RisingV.Core.dll
Provides extension methods for the Unity.Entities.World class to retrieve managed component data.
public static class WorldExtensions
- Inheritance
-
WorldExtensions
- Inherited Members
Methods
GetManagedComponentDataOrDefault<T>(World, EntityAspect)
Retrieves managed component data of type T for the specified entity aspect in the given world.
public static T? GetManagedComponentDataOrDefault<T>(this World world, EntityAspect entityAspect) where T : class
Parameters
worldWorldThe world from which to retrieve the managed component data.
entityAspectEntityAspectThe entity aspect for which to retrieve the managed component data.
Returns
- T
An instance of type
Tif it exists; otherwise, null.
Type Parameters
TThe type of the managed component data to retrieve. Must be a class.
GetManagedComponentDataOrDefault<T>(World, Entity, PrefabGUID?)
Retrieves managed component data of type T for the specified entity in the given world.
public static T? GetManagedComponentDataOrDefault<T>(this World world, Entity entity, PrefabGUID? prefabGuid = null) where T : class
Parameters
worldWorldThe world from which to retrieve the managed component data.
entityEntityThe entity for which to retrieve the managed component data.
prefabGuidPrefabGUID?Optional parameter to specify the prefab GUID associated with the entity. If not provided, it will be retrieved from the entity.
Returns
- T
An instance of type
Tif it exists; otherwise, null.
Type Parameters
TThe type of the managed component data to retrieve. Must be a class.