Sites

Menu

ViewCommandBuffer Class

Namespace: Improbable.Gdk.Core
GDK package: Core
Source

This class is for when a user wants to Add/Remove a Component (not IComponentData) during a system update without invalidating their injected arrays. The user must call Flush on this buffer at the end of the Update function to apply the buffered changes.


Constructors

ViewCommandBuffer Source
ViewCommandBuffer(EntityManager entityManager, ILogDispatcher logDispatcher)

Parameters


Methods

AddComponent<T> Source
void AddComponent<T>(Entity entity, T component)

Adds a GameObject Component to an ECS entity.

Parameters
  • Entity entity : The ECS entity
  • T component : The component

Type parameters:
  • T : The type of the component.
AddComponent Source
void AddComponent(Entity entity, ComponentType componentType, object componentObj)

Adds a GameObject Component to an ECS entity.

Parameters
  • Entity entity : The ECS entity
  • ComponentType componentType : The type of the component
  • object componentObj : The component
RemoveComponent Source
void RemoveComponent(Entity entity, ComponentType componentType)

Removes a GameObject Component from an ECS entity.

Parameters
  • Entity entity : The ECS entity.
  • ComponentType componentType : The type of the component to remove.
FlushBuffer Source
void FlushBuffer()

Plays back and applies all buffered actions in order.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums