ExclusiveEntityTransaction
Provides an interface to safely perform a subset of ExclusiveEntityTransaction.EntityManager operations from a single worker thread, by temporarily giving that thread exclusive access to a World 's ExclusiveEntityTransaction.EntityManager.
Read time 1 minuteLast updated a day ago
Definition
- Type: Struct
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
public struct ExclusiveEntityTransaction
Remarks
The intended use case for this interface is to let a worker thread stream Entity data into a staging World and perform any necessary post-processing structural changes, prior to moving the final data into the main simulation world using EntityManager.MoveEntitiesFrom. This lets the main thread continue to safely process the primary world while the new data is loading in, and not require a main-thread sync point until the new Entities are fully loaded and ready to be injected.
Warning: Only the ExclusiveEntityTransaction.EntityManager operations exposed by this struct are supported within the context of an exclusive entity transaction. For more information, refer to Safety in Entities.
Additional Resources: EntityManager.BeginExclusiveEntityTransaction, EntityManager.EndExclusiveEntityTransaction
Properties
Property | Description |
|---|---|
| EntityManager | Return the entity manager this transaction operates upon. |
Methods
Method | Description |
|---|---|
| SetComponentData | Sets the value of a component of an entity. |