A command buffer recording entity changes and execute these changes when calling Playback().
CommandBuffer is not thread safe. To record changes on arbitrary threads use Synced.
See Example.
public sealed class CommandBuffer :
Friflo.Engine.ECS.ICommandBuffer
Inheritance System.Object 🡒 CommandBuffer
Implements ICommandBuffer
Properties | |
---|---|
ChildCommandsCount | Return the number of recorded add / remove child commands. |
ComponentCommandsCount | Return the number of recorded components commands. |
EntityCommandsCount | Return the number of recorded entity commands. |
EntityStore | |
ReuseBuffer | Set ReuseBuffer = true to reuse a CommandBuffer instance for multiple Playback()'s. |
ScriptCommandsCount | Return the number of recorded script commands. |
Synced | Returns a command buffer that must be used in parallel queries - executed with RunParallel(). |
TagCommandsCount | Return the number of recorded tag commands. |
Methods | |
---|---|
AddChild(int, int) | Add the entity with the given childId as a child to the entity with the passed parentId. |
AddComponent<T>(int, T) | Add the given component with type T to the entity with the passed entityId. |
AddComponent<T>(int) | Add the IComponent with type T to the entity with the passed entityId. |
AddScript<T>(int, T) | Add the given script to the entity with the passed entityId. |
AddTag<T>(int) | Add the ITag with type T to the entity with the passed entityId. |
AddTags(int, Tags) | Add the tags to the entity with the passed entityId. |
Clear() | |
CreateEntity() | Creates a new entity on Playback() which will have the returned entity id. |
DeleteEntity(int) | Deletes the entity with the passed entityId on Playback(). |
Playback() | Execute recorded entity changes. Playback() must be called on the main thread. See Example. |
RemoveChild(int, int) | Remove the child entity with given childId from the parent entity with the the passed parentId. |
RemoveComponent<T>(int) | Remove the IComponent with type T from the entity with the passed entityId. |
RemoveScript<T>(int) | Remove the Script of the specified type T from the entity with the passed entityId. |
RemoveTag<T>(int) | Remove the ITag with type T from the entity with the passed entityId. |
RemoveTags(int, Tags) | Remove the tags from the entity with the passed entityId. |
ReturnBuffer() | Return the resources of the CommandBuffer to the EntityStore. |
SetComponent<T>(int, T) | Obsolete. Same behavior as AddComponent(int,T) . |
ToString() |