Skip to content

Instantly share code, notes, and snippets.

@chescales
Created September 17, 2014 09:46
Show Gist options
  • Save chescales/df0c6d384a1012b96832 to your computer and use it in GitHub Desktop.
Save chescales/df0c6d384a1012b96832 to your computer and use it in GitHub Desktop.
Infantium Unity Pausing&Resuming
public InfantiumPlugin infantium;
private bool isPaused = true;
void OnApplicationPause(bool isPause)
{
if (infantium == null)
return;
if (isPause && !isPaused) {
Debug.Log("Pausing Infantium...");
infantium.onPauseInfantium();
isPaused = true;
} else if (!isPause && isPaused) {
Debug.Log("Resuming Infantium...");
infantium.onResumeInfantium();
isPaused = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment