Created
September 17, 2014 09:46
-
-
Save chescales/df0c6d384a1012b96832 to your computer and use it in GitHub Desktop.
Infantium Unity Pausing&Resuming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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