Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

World

class in Unity.Entities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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

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 World.EntityManager can only process entities from the same World, etc.

Static Properties

Property Description
All List of all Worlds that currently exist in the application
DefaultGameObjectInjectionWorld The default World. The code that runs outside a system reads this property to reach a world.

Properties

Property Description
CurrentGroupAllocators Retrieve current double rewindable allocator for this World.
QuitUpdate Set this property to true to abort a world update after the next system update.
Systems List of all managed systems in this World
TimeSingleton Singleton instance of the Unity.Entities.WorldTime component. This data is generally accessed through World.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.
UpdateAllocatorEnableBlockFree Property to get and set enable block free flag, a flag indicating whether the allocator should enable individual block to be freed.

Constructors

Constructor Description
World Construct a new World instance

Public Methods

Method Description
AddSystemManaged Adds an existing system instance to this World
CreateSystem Create and return a handle to an instance of a system of type T in this World.
CreateSystemManaged Create and return an instance of a system of type T in this World.
DestroyAllSystemsAndLogException Destroy all system instances in the World. Any errors encountered during individual system destruction will be logged to the console.
DestroySystem Destroys one of the World's existing system instances.
DestroySystemManaged Destroys one of the World's existing system instances.
Dispose Dispose of a World instance
GetExistingSystem Return a handle to an existing instance of a system of type T in this World.
GetExistingSystemManaged Return an existing instance of a system of type T in this World.
GetOrCreateSystem Retrieve the handle for the instance of a system of type T from the current World. If the system does not exist in this World, it will first be created.
GetOrCreateSystemManaged Retrieve the instance of a system of type T from the current World. If the system does not exist in this World, it will first be created.
GetOrCreateSystemsAndLogException 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 World.PushTime
PushTime Push a new temporary time value to the World's current time
RestoreGroupAllocator Pop group allocator out of the stack.
SetGroupAllocator Push group allocator into a stack.
SetTime 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.

Static Methods

Method Description
DisposeAllWorlds Destroys all existing Worlds