Class World
Encapsulates a set of entities, component data, and systems.
Namespace: Unity.Entities
Assembly: Unity.Entities.dll
Syntax
public class World
Remarks
Multiple Worlds may exist concurrently in the same application, but they are isolated from each other; an EntityQuery will only match entities in the World that created the query, a World's EntityManager can only process entities from the same World, etc.
Constructors
Name | Description |
---|---|
World(string, WorldFlags) | Construct a new World instance |
World(string, WorldFlags, AllocatorHandle) | Construct a new World instance |
Properties
Name | Description |
---|---|
All | List of all Worlds that currently exist in the application |
CurrentGroupAllocators | Retrieve current double rewindable allocator for this World. |
DefaultGameObjectInjectionWorld | Reference to the default World |
EntityManager | An interface to manipulate the World's entity data from the main thread |
Flags | The WorldFlags settings for this World |
IsCreated | Has this World been successfully initialized? |
MaximumDeltaTime | The maximum single-frame delta time permitted in this world. |
Name | The name of the World |
NextSequenceNumber | Increments whenever a world is created or destroyed, or when an EntityQuery is created. |
QuitUpdate | Set this property to true to abort a world update after the next system update. |
SequenceNumber | The World's current sequence number |
Systems | List of all managed systems in this World |
Time | The world's simulated time, include elapsed time since World creation and the delta time since the previous update. |
TimeSingleton | Singleton instance of the WorldTime component. This data is generally accessed through Time. |
Unmanaged | Gives access to the unmanaged data of an instance of the World. This is useful when your code needs to run with Burst. |
UpdateAllocator | Rewindable allocator instance for this World. |
UpdateAllocatorEnableBlockFree | Property to get and set enable block free flag, a flag indicating whether the allocator should enable individual block to be freed. |
Version | The World's current version number |
Methods
Name | Description |
---|---|
AddSystemManaged<T>(T) | Adds an existing system instance to this World |
AddSystem<T>(T) | Obsolete. Use AddSystemManaged<T>(T) instead. |
CreateSystem(Type) | Create and return a handle to an instance of a system of type |
CreateSystem(SystemTypeIndex) | Create and return a handle to an instance of a system of type |
CreateSystemManaged(Type) | Create and return an instance of a system of type |
CreateSystemManaged(SystemTypeIndex) | Create and return an instance of a system of type |
CreateSystemManaged<T>() | Create and return an instance of a system of type |
CreateSystem<T>() | Create and return a handle to an instance of a system of type |
DestroyAllSystemsAndLogException() | Destroy all system instances in the World. Any errors encountered during individual system destruction will be logged to the console. |
DestroyAllSystemsAndLogException(out bool) | Destroy all system instances in the World. Any errors encountered during individual system destruction will be logged to the console. |
DestroySystem(SystemHandle) | Destroys one of the World's existing system instances. |
DestroySystemManaged(ComponentSystemBase) | Destroys one of the World's existing system instances. |
Dispose() | Dispose of a World instance |
DisposeAllWorlds() | Destroys all existing Worlds |
GetExistingSystem(Type) | Return a handle to an existing instance of a system of type |
GetExistingSystem(SystemTypeIndex) | Return a handle to an existing instance of a system of type |
GetExistingSystemManaged(Type) | Return an existing instance of a system of type |
GetExistingSystemManaged(SystemTypeIndex) | Return an existing instance of a system of type |
GetExistingSystemManaged<T>() | Return an existing instance of a system of type |
GetExistingSystem<T>() | Return a handle to an existing instance of a system of type |
GetOrCreateSystem(Type) | Retrieve the handle for the instance of a system of type |
GetOrCreateSystem(SystemTypeIndex) | Retrieve the handle for the instance of a system of type |
GetOrCreateSystemManaged(Type) | Retrieve the instance of a system of type |
GetOrCreateSystemManaged(SystemTypeIndex) | Retrieve the instance of a system of type |
GetOrCreateSystemManaged<T>() | Retrieve the instance of a system of type |
GetOrCreateSystem<T>() | Retrieve the handle for the instance of a system of type |
GetOrCreateSystemsAndLogException(NativeList<SystemTypeIndex>, AllocatorHandle) | Creates systems from the list of types which aren't already created in the current world. |
PopTime() | Restore the previous World time, after pushing a temporary time value with PushTime(TimeData) |
PushTime(TimeData) | Push a new temporary time value to the World's current time |
RestoreGroupAllocator(DoubleRewindableAllocators*) | Pop group allocator out of the stack. |
SetGroupAllocator(DoubleRewindableAllocators*) | Push group allocator into a stack. |
SetTime(TimeData) | Assigns a new value to the World's current time. |
ToString() | Returns the name of the World |
Update() | Update the World's default system groups. |