Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public IEnumerator AsyncSend()
  2. {
  3. ...
  4. yield return www;
  5. ...
  6. }
  7.  
  8. IEnumerator coroutine = AsyncSend();
  9. StartCoroutine(coroutine); //http://docs.unity3d.com/ScriptReference/MonoBehaviour.StartCoroutine.html
  10.  
  11. void Update()
  12. {
  13. ...
  14. //timeout
  15. if (...)
  16. {
  17. StopCoroutine(coroutine); //http://docs.unity3d.com/ScriptReference/MonoBehaviour.StopCoroutine.html
  18. www.Dispose(); //http://docs.unity3d.com/ScriptReference/WWW.Dispose.html
  19. }
  20. ...
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement