# World

> Encapsulates a set of entities, component data, and systems.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class World : IDisposable
```

## Remarks

Multiple Worlds may exist concurrently in the same application, but they are isolated from each other; an [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md) 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

| Constructor                                                                                                                                                                                                  | Description                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ |
| [World(System.String,Unity.Entities.WorldFlags)](/engine/7000.0/script-reference/unity/entities/world/ctor.md#world\(string-worldflags\))                                                                    | Construct a new World instance |
| [World(System.String,Unity.Entities.WorldFlags,Unity.Collections.AllocatorManager.AllocatorHandle)](/engine/7000.0/script-reference/unity/entities/world/ctor.md#world\(string-worldflags-allocatorhandle\)) | Construct a new World instance |

## Properties

| Property                                                                                                                 | Description                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| [CurrentGroupAllocators](/engine/7000.0/script-reference/unity/entities/world/currentgroupallocators.md)                 | Retrieve current double rewindable allocator for this World.                                                                        |
| [QuitUpdate](/engine/7000.0/script-reference/unity/entities/world/quitupdate.md)                                         | Set this property to true to abort a world update after the next system update.                                                     |
| [Systems](/engine/7000.0/script-reference/unity/entities/world/systems.md)                                               | List of all managed systems in this World                                                                                           |
| [TimeSingleton](/engine/7000.0/script-reference/unity/entities/world/timesingleton.md)                                   | Singleton instance of the WorldTime component. This data is generally accessed through Time.                                        |
| [Unmanaged](/engine/7000.0/script-reference/unity/entities/world/unmanaged.md)                                           | Gives access to the unmanaged data of an instance of the World. This is useful when your code needs to run with Burst.              |
| [UpdateAllocatorEnableBlockFree](/engine/7000.0/script-reference/unity/entities/world/updateallocatorenableblockfree.md) | Property to get and set enable block free flag, a flag indicating whether the allocator should enable individual block to be freed. |

## Static Properties

| Property                                                                                                                   | Description                                                                                                                                             |
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [All](/engine/7000.0/script-reference/unity/entities/world/all.md)                                                         | List of all Worlds that currently exist in the application                                                                                              |
| [DefaultGameObjectInjectionWorld](/engine/7000.0/script-reference/unity/entities/world/defaultgameobjectinjectionworld.md) | The default [World](/engine/7000.0/script-reference/unity/entities/world.md). The code that runs outside a system reads this property to reach a world. |

## Methods

| Method                                                                                                                         | Description                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddSystemManaged](/engine/7000.0/script-reference/unity/entities/world/addsystemmanaged.md)                                   | Adds an existing system instance to this World                                                                                                                                    |
| [CreateSystem](/engine/7000.0/script-reference/unity/entities/world/createsystem.md)                                           | Create and return a handle to an instance of a system of type `type` in this World.                                                                                               |
| [CreateSystemManaged](/engine/7000.0/script-reference/unity/entities/world/createsystemmanaged.md)                             | Create and return an instance of a system of type `type` in this World.                                                                                                           |
| [DestroyAllSystemsAndLogException](/engine/7000.0/script-reference/unity/entities/world/destroyallsystemsandlogexception.md)   | Destroy all system instances in the World. Any errors encountered during individual system destruction will be logged to the console.                                             |
| [DestroySystem](/engine/7000.0/script-reference/unity/entities/world/destroysystem.md)                                         | Destroys one of the World's existing system instances.                                                                                                                            |
| [DestroySystemManaged](/engine/7000.0/script-reference/unity/entities/world/destroysystemmanaged.md)                           | Destroys one of the World's existing system instances.                                                                                                                            |
| [Dispose](/engine/7000.0/script-reference/unity/entities/world/dispose.md)                                                     | Dispose of a World instance                                                                                                                                                       |
| [GetExistingSystem](/engine/7000.0/script-reference/unity/entities/world/getexistingsystem.md)                                 | Return a handle to an existing instance of a system of type `type` in this World. Prefer the version that takes a SystemTypeIndex where possible to avoid unnecessary reflection. |
| [GetExistingSystemManaged](/engine/7000.0/script-reference/unity/entities/world/getexistingsystemmanaged.md)                   | Return an existing instance of a system of type `type` in this World. Prefer the version that takes a SystemTypeIndex where possible to avoid unnecessary reflection.             |
| [GetOrCreateSystem](/engine/7000.0/script-reference/unity/entities/world/getorcreatesystem.md)                                 | Retrieve the handle for the instance of a system of type `type` from the current World. If the system does not exist in this World, it will first be created.                     |
| [GetOrCreateSystemManaged](/engine/7000.0/script-reference/unity/entities/world/getorcreatesystemmanaged.md)                   | Retrieve the instance of a system of type `type` from the current World. If the system does not exist in this World, it will first be created.                                    |
| [GetOrCreateSystemsAndLogException](/engine/7000.0/script-reference/unity/entities/world/getorcreatesystemsandlogexception.md) | Creates systems from the list of types which aren't already created in the current world.                                                                                         |
| [PopTime](/engine/7000.0/script-reference/unity/entities/world/poptime.md)                                                     | Restore the previous World time, after pushing a temporary time value with [World.PushTime](/engine/7000.0/script-reference/unity/entities/world/pushtime.md)                     |
| [PushTime](/engine/7000.0/script-reference/unity/entities/world/pushtime.md)                                                   | Push a new temporary time value to the World's current time                                                                                                                       |
| [RestoreGroupAllocator](/engine/7000.0/script-reference/unity/entities/world/restoregroupallocator.md)                         | Pop group allocator out of the stack.                                                                                                                                             |
| [SetGroupAllocator](/engine/7000.0/script-reference/unity/entities/world/setgroupallocator.md)                                 | Push group allocator into a stack.                                                                                                                                                |
| [SetTime](/engine/7000.0/script-reference/unity/entities/world/settime.md)                                                     | Assigns a new value to the World's current time.                                                                                                                                  |
| [ToString](/engine/7000.0/script-reference/unity/entities/world/tostring.md)                                                   | Returns the name of the World                                                                                                                                                     |
| [Update](/engine/7000.0/script-reference/unity/entities/world/update.md)                                                       | Update the World's default system groups.                                                                                                                                         |

## Static Methods

| Method                                                                                       | Description                  |
| -------------------------------------------------------------------------------------------- | ---------------------------- |
| [DisposeAllWorlds](/engine/7000.0/script-reference/unity/entities/world/disposeallworlds.md) | Destroys all existing Worlds |

## Structs

| Struct                                                                                                                    | Description                                                                |
| ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [World.NoAllocReadOnlyCollection\<T>](/engine/7000.0/script-reference/unity/entities/world/noallocreadonlycollection1.md) | Read only collection that doesn't generate garbage when used in a foreach. |
