docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class World

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

    Inheritance
    object
    World
    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 type in this World.

    CreateSystem(SystemTypeIndex)

    Create and return a handle to an instance of a system of type type in this World.

    CreateSystemManaged(Type)

    Create and return an instance of a system of type type in this World.

    CreateSystemManaged(SystemTypeIndex)

    Create and return an instance of a system of type type in this World.

    CreateSystemManaged<T>()

    Create and return an instance of a system of type T in this World.

    CreateSystem<T>()

    Create and return a handle to 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.

    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 type in this World. Prefer the version that takes a SystemTypeIndex where possible to avoid unnecessary reflection.

    GetExistingSystem(SystemTypeIndex)

    Return a handle to an existing instance of a system of type type in this World. This version avoids unnecessary reflection.

    GetExistingSystemManaged(Type)

    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.

    GetExistingSystemManaged(SystemTypeIndex)

    Return an existing instance of a system of type type in this World. This avoids unnecessary reflection.

    GetExistingSystemManaged<T>()

    Return an existing instance of a system of type T in this World.

    GetExistingSystem<T>()

    Return a handle to an existing instance of a system of type T in this World.

    GetOrCreateSystem(Type)

    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.

    GetOrCreateSystem(SystemTypeIndex)

    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(Type)

    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.

    GetOrCreateSystemManaged(SystemTypeIndex)

    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.

    GetOrCreateSystemManaged<T>()

    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.

    GetOrCreateSystem<T>()

    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.

    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.

    Extension Methods

    WorldExtensions.AddSystem<T>(World)
    WorldExtensions.CreateSystem<T>(World)
    WorldExtensions.DestroyUnmanagedSystem(World, SystemHandle)
    WorldExtensions.GetExistingSystem<T>(World)
    WorldExtensions.GetOrCreateSystem<T>(World)
    WorldExtensions.GetOrCreateUnmanagedSystem(World, Type)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)