EnableMultithreading
void EnableMultithreading();
Enables multithreading for the script. If previously disabled, all previously added functions will be returned to the internal Threadpool.
Example
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : ThreadHarmonizerEngine.MonoBehaviourMultithreaded
{
// Start is called before the first frame update
void Start()
{
AddFunction(ParallelUpdate);
}
// ParallelUpdate is called once per frame
void ParallelUpdate()
{
}
private void OnDestroy()
{
DisableMultithreading();
}
private void OnDisable()
{
DisableMultithreading();
}
private void OnEnable()
{
EnableMultithreading();
}
}