Table of Contents

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

world World

The world from which to retrieve the managed component data.

entityAspect EntityAspect

The entity aspect for which to retrieve the managed component data.

Returns

T

An instance of type T if it exists; otherwise, null.

Type Parameters

T

The 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

world World

The world from which to retrieve the managed component data.

entity Entity

The entity for which to retrieve the managed component data.

prefabGuid PrefabGUID?

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 T if it exists; otherwise, null.

Type Parameters

T

The type of the managed component data to retrieve. Must be a class.