Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2012 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4325303 to your computer and use it in GitHub Desktop.
Save anonymous/4325303 to your computer and use it in GitHub Desktop.
pause your game in unity
def _Sleep(duration as single) as IEnumerator:
while duration > 0.0F:
unless pause:
duration -= Time.deltaTime
yield
def Sleep(duration as single) as Coroutine:
return StartCoroutine(_Sleep(1.0F))
def _Sleep() as IEnumerator:
while Temp.Fpause or Temp.FeventWait:
yield
def Sleep() as Coroutine:
return StartCoroutine(_Sleep())
#ex
yield Sleep(1.0F)
yield Sleep()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment