Class ScriptBehaviourUpdateOrder
Namespace: Unity.Entities
Syntax
public static class ScriptBehaviourUpdateOrder
Methods
AddWorldToCurrentPlayerLoop(World)
Add this World's three default top-level system groups to the current Unity player loop.
Declaration
public static void AddWorldToCurrentPlayerLoop(World world)
Parameters
Type | Name | Description |
---|---|---|
World | world | The three top-level system groups from this World will be added to the provided player loop. |
Remarks
This is a convenience wrapper around AddWorldToPlayerLoop() that retrieves the current player loop, adds a World's top-level system groups to it, and sets the modified copy as the new active player loop.
Note that modifications to the active player loop do not take effect until to the next iteration through the player loop.
AddWorldToPlayerLoop(World, ref PlayerLoopSystem)
Add this World's three default top-level system groups to a PlayerLoopSystem object.
Declaration
public static void AddWorldToPlayerLoop(World world, ref PlayerLoopSystem playerLoop)
Parameters
Type | Name | Description |
---|---|---|
World | world | The three top-level system groups from this World will be added to the provided player loop. |
PlayerLoopSystem | playerLoop | Existing player loop to modify (e.g. (e.g. PlayerLoop.GetCurrentPlayerLoop()) |
Remarks
This function performs the following modifications to the provided PlayerLoopSystem:
- If an instance of InitializationSystemGroup exists in this World, it is appended to the Initialization player loop phase.
- If an instance of SimulationSystemGroup exists in this World, it is appended to the Update player loop phase.
- If an instance of PresentationSystemGroup exists in this World, it is appended to the PreLateUpdate player loop phase. If instances of any or all of these system groups don't exist in this World, then no entry is added to the player loop for that system group.
This function does not change the currently active player loop. If this behavior is desired, it's necessary to call PlayerLoop.SetPlayerLoop(playerLoop) after the systems have been removed.
AppendSystemToPlayerLoopList(ComponentSystemBase, ref PlayerLoopSystem, Type)
Add an ECS system to a specific point in the Unity player loop, so that it is updated every frame.
Declaration
public static void AppendSystemToPlayerLoopList(ComponentSystemBase system, ref PlayerLoopSystem playerLoop, Type playerLoopSystemType)
Parameters
Type | Name | Description |
---|---|---|
ComponentSystemBase | system | The ECS system to add to the player loop. |
PlayerLoopSystem | playerLoop | Existing player loop to modify (e.g. PlayerLoop.GetCurrentPlayerLoop()) |
Type | playerLoopSystemType | The Type of the PlayerLoopSystem subsystem to which the ECS system should be appended. See the UnityEngine.PlayerLoop namespace for valid values. |
Remarks
This function does not change the currently active player loop. If this behavior is desired, it's necessary to call PlayerLoop.SetPlayerLoop(playerLoop) after the systems have been removed.
IsWorldInCurrentPlayerLoop(World)
Search the currently active player loop for any systems added by this World.
Declaration
public static bool IsWorldInCurrentPlayerLoop(World world)
Parameters
Type | Name | Description |
---|---|---|
World | world | The function will search the currently active player loop for systems owned by this World. |
Returns
Type | Description |
---|---|
Boolean |
Remarks
This is a convenience wrapper around IsWorldInPlayerLoop() that always searches the currently active player loop.
IsWorldInPlayerLoop(World, PlayerLoopSystem)
Search the provided player loop for any systems added by this World.
Declaration
public static bool IsWorldInPlayerLoop(World world, PlayerLoopSystem playerLoop)
Parameters
Type | Name | Description |
---|---|---|
World | world | The function will search the provided PlayerLoopSystem for systems owned by this World. |
PlayerLoopSystem | playerLoop | Existing player loop to search (e.g. PlayerLoop.GetCurrentPlayerLoop()) |
Returns
Type | Description |
---|---|
Boolean | True if any of this World's systems are found in the provided player loop; otherwise, false. |
Remarks
Note that systems are not added to the player loop directly; they are wrapped by a DummyDelegate object that calls the system's Update() method. Any systems added to the loop using other wrapper mechanisms will not be detected by this function.
RemoveWorldFromCurrentPlayerLoop(World)
Remove all of this World's systems from the currently active player loop.
Declaration
public static void RemoveWorldFromCurrentPlayerLoop(World world)
Parameters
Type | Name | Description |
---|---|---|
World | world | All systems in the current player loop owned by this World will be removed from the player loop. |
Remarks
This is a convenience wrapper around RemoveWorldToPlayerLoop() that retrieves the current player loop, removes a World's systems from it, and sets the modified copy as the new active player loop.
Note that modifications to the active player loop do not take effect until to the next iteration through the player loop.
RemoveWorldFromPlayerLoop(World, ref PlayerLoopSystem)
Remove all of this World's systems from the specified player loop.
Declaration
public static void RemoveWorldFromPlayerLoop(World world, ref PlayerLoopSystem playerLoop)
Parameters
Type | Name | Description |
---|---|---|
World | world | All systems in the provided player loop owned by this World will be removed from the player loop. |
PlayerLoopSystem | playerLoop | Existing player loop to modify (e.g. PlayerLoop.GetCurrentPlayerLoop()) |
Remarks
Only the systems from this World will be removed; other player loop modifications (including systems added by other Worlds) will not be affected.
This function does not change the currently active player loop. If this behavior is desired, it's necessary to call PlayerLoop.SetPlayerLoop(playerLoop) after the systems have been removed.