GetOrCreateSystem
Retrieve the handle for an 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.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
GetOrCreateSystem<T>(World)
Retrieve the handle for an instance of a system of type from the current World. If the system does not exist in this World, it will first be created.
Tpublic static SystemHandle GetOrCreateSystem<T>(this World self) where T : unmanaged, ISystem
Parameters
The World
Returns
Type | Description |
|---|---|
| SystemHandle | The instance's handle of system type |
Remarks
Important: This function creates a sync point if a system is created, which means that the EntityManager waits for all currently running Jobs to complete before creating the system, 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.
GetOrCreateSystem(World, Type)
Obsolete. Use World.GetOrCreateSystem instead.
public static SystemHandle GetOrCreateSystem(World self, Type unmanagedType)
Parameters
Returns
Type | Description |
|---|---|
| SystemHandle |