Documentation › RemoveFunction
RemoveFunction
Removes a previously registered recurring function from the worker workflow.
Instance method
C# API
METHOD SIGNATURE
void RemoveFunction(Action function);
Description
Removes the matching function that was previously registered with AddFunction. After removal, the function no longer participates in recurring worker execution.
Matching delegate
Pass the same method reference that was originally supplied to AddFunction.
Targeted removal
Other registered worker functions on the component remain unchanged.
Parameters
Name
Type
Description
function
Action
The previously registered parameterless function that should be removed.
Code Example
EXAMPLE
using ThreadHarmonizerEngine;
using UnityEngine;
public class RemovableCalculation : MonoBehaviourMultithreaded
{
private void Start()
{
AddFunction(ParallelUpdate);
}
public void StopCalculation()
{
RemoveFunction(ParallelUpdate);
}
private void ParallelUpdate()
{
// Recurring Unity-independent calculation.
}
}
