Skip to content

Instantly share code, notes, and snippets.

@kirillrybin
Created March 31, 2015 08:09
Show Gist options
  • Save kirillrybin/81e7e7a82f2eca4bafac to your computer and use it in GitHub Desktop.
Save kirillrybin/81e7e7a82f2eca4bafac to your computer and use it in GitHub Desktop.
Unity3D | Yield WaitForSeconds outside of time.Scale
using UnityEngine;
using System.Collections;
public static class CoroutineUtil
{
public static IEnumerator WaitForRealSeconds(float time)
{
var start = Time.realtimeSinceStartup;
while (Time.realtimeSinceStartup < start + time)
{
yield return null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment