I have an async function call myAsyncfuntion() which look like that
public async Task TakePhotoBasicAndSaveAndDisplayUWP()
{
var photoImplementation = new MediaCaptureImplementation();
photoImplementation.TakePhotoTexture2DAsync();
// Some code here...
await photoImplementation.SavePhotoToPicturesLibraryAsync();
}
Now I would like to call this function from another non async function so I do like this. Basically I attact a button to TakePhotoBasicAndSaveAndDisplay() and whenever the button got clicked, the function will start the async function inside. But the async function seem not to be called.
public void TakePhotoBasicAndSaveAndDisplay()
{
#if WINDOWS_UWP
var task = Task.Run(async () => await TakePhotoBasicAndSaveAndDisplayUWP());
#endif
}
Could anyone help me ? I am working with unity