Event: onThrottleChange - WarezCrawler/Guybrush101 GitHub Wiki

The "onThrottleChange" event is fired when the inflight global throttle is changed.

It is very important to remove any reference to the event in the onDestroy() method to avoid memory leaking.


Example on have to subscribe to the event:

public void onStart() 
{

	onThrottleChangeEvent = GameEvents.FindEvent<EventVoid>("onThrottleChange");
	if (onThrottleChangeEvent != null)
	{
		onThrottleChangeEvent.Add(myMethod);
	}
}

private void myMethod()
{
	//Some method to run when the throttle changes
}

private void OnDestroy()
{

	if (onThrottleChangeEvent != null) onThrottleChangeEvent.Remove(myMethod);
}

⚠️ **GitHub.com Fallback** ⚠️