Created
December 1, 2014 16:09
-
-
Save JessyCatterwaul/4143961df81216a7ddf6 to your computer and use it in GitHub Desktop.
Coroutine continue failure
This file contains hidden or 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
using System.Collections; | |
using UnityEngine; | |
public class CoroutineContinueFailure: MonoBehaviour { | |
void Start() { | |
LogTimeCoroutine = StartCoroutine(LogTime()); | |
} | |
Coroutine LogTimeCoroutine; | |
IEnumerator LogTime() { | |
while (true) { | |
Debug.Log(Time.time); | |
yield return null; | |
} | |
} | |
void Update() { | |
if (Time.time > 1) StopCoroutine(LogTimeCoroutine); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment