Live Data Reference #
Entity Class #
An Entity data class has the following properties and functions:
| Property | Description |
|---|---|
entityName: EntityName | The name for a type of data in your player data feature. This name does not have to be unique, but it must be different compared to other Component declarations. |
instancedId: UUID | The unique ID for the instance of the Entity. |
componentContainers: MutableList<ComponentContainer> | The list of Components belonging to the specific Entity. |
getComponents() | Returns a list of Components. |
addComponent() | Fetches a Component, creates a ComponentContainer for said Component, and then adds the newly created ComponentContainer to the componentContainers collection. |
removeComponent(componentId: UUID) | Removes a Component from the componentsContainers collection by its componentId. |
removeComponent(component: Component) | Removes Component(s) from the componentsContainers collection. |
getComponentsByType<reified T: Component>() | Returns a list of Components that are an instance of the generic parameter. |
Component Container Class #
A ComponentContainer data class has the following properties:
| Property | Description |
|---|---|
componentId: UUID | The unique ID that identifies the Component and helps with data persistence. |
component: Component | Utilized by the engine layer to contain the Component. |
Player Data Service SDK #
Below are all of the accessor methods available in the Unreal SDK’s FPlayerDataCache which is accessed through UPragmaPlayerDataService.GetCache().
| Method | Description |
|---|---|
GetEntityByInstanceId(const FString& InstanceId) | Fetches one specific Entity by its associated instanceId or string. |
GetEntitiesByName(const FString& Name) | Fetches a list of Entities by a shared name. |
GetUniqueEntityByName(const FString& Name) | Fetches one specific Entity solely by its name.Use to fetch an Entity that is known to have a unique name. |
AllInstanceIds() | Fetches all InstanceIds.Use in combination with GetEntityByInstanceId to loop through all of a player’s entities |