Class PlayerLoopSystemExtensions
UnityEngine.LowLevel.PlayerLoopSystem Based Extension Methods
Inheritance
Namespace: GDX
Syntax
public static class PlayerLoopSystemExtensions
Methods
| Improve this Doc View SourceAddSubSystem(ref PlayerLoopSystem, ref PlayerLoopSystem)
Adds a child (sub) system to the provided parentSystem.
Declaration
public static void AddSubSystem(this ref PlayerLoopSystem parentSystem, ref PlayerLoopSystem subSystem)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | parentSystem | The parent system which a child (sub) system should be added too. |
| UnityEngine.LowLevel.PlayerLoopSystem | subSystem | The child (sub) system that is to be added to the parent. |
AddSubSystemToFirstSubSystemOfType(ref PlayerLoopSystem, Type, Type, PlayerLoopSystem.UpdateFunction)
Adds a child (sub) system to the first found instance of a parentSystemType system in
rootSystem.
Declaration
public static bool AddSubSystemToFirstSubSystemOfType(this ref PlayerLoopSystem rootSystem, Type parentSystemType, Type subSystemType, PlayerLoopSystem.UpdateFunction subSystemUpdateFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | rootSystem | The root system which the |
| System.Type | parentSystemType | The system System.Type that will be searched for as the parent. |
| System.Type | subSystemType | The type assigned when creating the UnityEngine.LowLevel.PlayerLoopSystem to be added. |
| UnityEngine.LowLevel.PlayerLoopSystem.UpdateFunction | subSystemUpdateFunction | The method to invoke when the system is updated. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true/false if the |
Examples
PlayerLoopSystem systemRoot = PlayerLoop.GetCurrentPlayerLoop();
systemRoot.AddSubSystemToFirstSubSystemOfType(
typeof(Update.ScriptRunDelayedTasks),
typeof(TaskDirectorSystem), PlayerLoopTick);
PlayerLoop.SetPlayerLoop(systemRoot);
|
Improve this Doc
View Source
AddSubSystemToFirstSubSystemOfType(ref PlayerLoopSystem, Type, ref PlayerLoopSystem)
Adds a child (sub) system to the first found instance of a parentSystemType system in
rootSystem.
Declaration
public static bool AddSubSystemToFirstSubSystemOfType(this ref PlayerLoopSystem rootSystem, Type parentSystemType, ref PlayerLoopSystem subSystem)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | rootSystem | The root system which the |
| System.Type | parentSystemType | The system System.Type that will be searched for as the parent. |
| UnityEngine.LowLevel.PlayerLoopSystem | subSystem | The child (sub) system that is to be added to the parent. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true/false if the |
GenerateSystemTree(ref PlayerLoopSystem, TextGenerator)
Populates a TextGenerator with a tree-like structure that represents the
UnityEngine.LowLevel.PlayerLoopSystem found under the rootSystem.
Declaration
public static TextGenerator GenerateSystemTree(this ref PlayerLoopSystem rootSystem, TextGenerator generator = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | rootSystem | The root system which the tree should be crafted based off of. |
| TextGenerator | generator | Optionally, provide a generator to be populated. |
Returns
| Type | Description |
|---|---|
| TextGenerator | A TextGenerator populated with the system output. |
RemoveSubSystemsOfType(ref PlayerLoopSystem, Type)
Removes all child (sub) systems of the specified subSystemType from the provided
parentSystem.
Declaration
public static bool RemoveSubSystemsOfType(this ref PlayerLoopSystem parentSystem, Type subSystemType)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | parentSystem | The parent system which the child (sub) systems should be removed from. |
| System.Type | subSystemType | The system System.Type that will be removed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true/false, if a remove was done. |
Remarks
This is NOT recursive, and will not effect the child (sub) systems of the child (sub) systems of the
parentSystem
RemoveSubSystemsOfTypeFromFirstSubSystemOfType(ref PlayerLoopSystem, Type, Type)
Removes all the child (sub) systems of to the first found instance of a parentSystemType system
in rootSystem
Declaration
public static bool RemoveSubSystemsOfTypeFromFirstSubSystemOfType(this ref PlayerLoopSystem rootSystem, Type parentSystemType, Type subSystemType)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | rootSystem | The root system which the |
| System.Type | parentSystemType | The system System.Type that will be searched for as the parent. |
| System.Type | subSystemType | The child (sub) system System.Type that will be removed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true/false, if a remove occured. |
ReplaceFirstSubSystemOfType(ref PlayerLoopSystem, Type, ref PlayerLoopSystem)
Replaces the first child (sub) system of the given rootSystem of
subSystemType with the provided updatedSystem.
Declaration
public static bool ReplaceFirstSubSystemOfType(this ref PlayerLoopSystem rootSystem, Type subSystemType, ref PlayerLoopSystem updatedSystem)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | rootSystem | The root system which the |
| System.Type | subSystemType | The child (sub) system System.Type that will be replaced. |
| UnityEngine.LowLevel.PlayerLoopSystem | updatedSystem | The system to replace the found |
Returns
| Type | Description |
|---|---|
| System.Boolean | true/false if the replace occured. |
ReplaceSubSystemsOfType(ref PlayerLoopSystem, Type, ref PlayerLoopSystem)
Replaces all child (sub) systems of the specified subSystemType from the provided
parentSystem.
Declaration
public static bool ReplaceSubSystemsOfType(this ref PlayerLoopSystem parentSystem, Type subSystemType, ref PlayerLoopSystem updatedSystem)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | parentSystem | The parent system which the child (sub) systems should be replaced. |
| System.Type | subSystemType | The system System.Type that will be replaced. |
| UnityEngine.LowLevel.PlayerLoopSystem | updatedSystem | The system to replace the found |
Returns
| Type | Description |
|---|---|
| System.Boolean | true/false if any replacement occured. |
Remarks
This is NOT recursive, and will not effect the child (sub) systems of the child (sub) systems of the
parentSystem
TryGetFirstSubSystemOfType(ref PlayerLoopSystem, Type, out Boolean)
Searches the provided rootSystem child (sub) systems for the first instance of a
subSystemType system.
Declaration
public static ref PlayerLoopSystem TryGetFirstSubSystemOfType(this ref PlayerLoopSystem rootSystem, Type subSystemType, out bool foundSubSystem)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | rootSystem | The root system which the |
| System.Type | subSystemType | The child (sub) system System.Type that will be searched for recursively. |
| System.Boolean | foundSubSystem | Was an appropriate system found? |
Returns
| Type | Description |
|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | The found system, or the root system. Check |
TryGetFirstSystemWithSubSystemOfType(ref PlayerLoopSystem, Type, out Boolean, out Int32)
Searches the provided rootSystem child (sub) systems for the first instance of a
subSystemType and returns the parent system, with foundSystemIndex
of the found child (sub) system.
Declaration
public static ref PlayerLoopSystem TryGetFirstSystemWithSubSystemOfType(this ref PlayerLoopSystem rootSystem, Type subSystemType, out bool foundSubSystem, out int foundSystemIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | rootSystem | The root system which the |
| System.Type | subSystemType | The child (sub) system System.Type that will be searched for recursively. |
| System.Boolean | foundSubSystem | Was an appropriate child (sub) system found? |
| System.Int32 | foundSystemIndex | The index of the found sub (child) system. |
Returns
| Type | Description |
|---|---|
| UnityEngine.LowLevel.PlayerLoopSystem | The found parent system, or the root system. Check |