Documentation

Unity Engine


Unity Engine


GetOrCreateSystemsAndLogException(NativeList<SystemTypeIndex>, AllocatorHandle)

Creates systems from the list of types which aren't already created in the current world.
Read time 1 minuteLast updated 11 hours ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public NativeList<SystemHandle> GetOrCreateSystemsAndLogException(NativeList<SystemTypeIndex> types, AllocatorManager.AllocatorHandle allocator)

Parameters

The system types to create, in the order in which they should be created.

The allocator to use to allocate the output system list

Returns

Type

Description

NativeList<SystemHandle>A list of system instances

Remarks

This function creates systems in the order they are passed in, and ignores CreateBeforeAttribute and CreateAfterAttribute validity. If errors are encountered either when creating the system or when calling OnCreate, a default SystemHandle will be returned for that system.
Important: This function creates a sync point if any systems are created, which means that the EntityManager waits for all currently running Jobs to complete before creating the systems, and no additional Jobs can start before the function is finished. A sync point can cause a drop in performance because the ECS framework may not be able to make use of the processing power of all available cores.