Created
October 4, 2016 06:30
-
-
Save neuecc/42aaf410e09d1a5f914fea9a74e4a2da to your computer and use it in GitHub Desktop.
for Blog #4
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
async Task AwaitObservable() | |
{ | |
Debug.Log("start await observable"); | |
await Observable.NextFrame(); // like yield return null | |
await Observable.TimerFrame(5); // await 5 frame | |
try | |
{ | |
// ObservableWWW promote exception when await(difference in await WWW) | |
var result = await ObservableWWW.Get("https://404.com"); | |
Debug.Log(result); | |
} | |
catch (WWWErrorException ex) | |
{ | |
Debug.LogError(ex.ToString()); | |
} | |
Debug.Log("end await observable"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment