Using GetObjectAsync() in the Unity package there is no callback to measure download progress as there is with PostObjectAsync(). There seems to be WriteObjectProgressEvent in the normal .Net S3 package but this is missing from the Unity package.
Thanks @AndrewRH for reporting this -- I am dealing with the same problem. Did you ever figure out a way to make this work?
Hey! I'm in need of the same functionality. Both Unity WWW and UnityWebRequest classes support progress indication and there's already upload progress callback in AmazonS3Client for Unity. Does anyone with a better understanding of AWS S3 sdk has an idea how I could implement this myself?
I'd be nice to have this, as well as cancellation support.
i am also having the same problem. Is there any workaround for this?
Also having the same problem, this seems like a pretty big oversight. Sometimes grabbing a relatively small file takes a long time and without a way of showing that it's still working, people just assume it's broken (including myself sometimes).
The problem still does not seem to have an official solution. How did you guys manage to solve it ?
Could using AWS for .Net instead of AWS for Unity be a solution ? (I don't even know if this is possible)
+1. We're having to resort to compiling the .NET sdk as a DLL to use download progress in Unity, but this seems silly considering there's a Unity library.
A lighter solution using only the Unity sdk is given by @DaleEmrose here : https://github.com/amazon-archives/aws-sdk-unity/issues/68 (pointed by this repository's FEATURE_REQUESTS.md file).
It's quite old so I had to adapt it a bit, I can provide some code if this can help.
@olafolafsson awesome! Would love any tips. The current unity AWS SDK is distributed as a DLL and wouldn't want to go back to the old version just for this.
Ideally when Unity 2018.1 ships with official support for .NET Standard 2.0 (yay async
and await
!) we can just switch over to consuming "normal" version of this library and it _just works._ (I have my reservations, considering Unity keeps breaking random things in their iOS implementation of UnityWebRequest...)
Apparently this SDK targets .NET Standard 1.3: https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/welcome.html
@olafolafsson nevermind, figured it out! The suggested solution worked great, thanks :)
For future visitors of this page : in UnityMainThreadDispatcher.cs, for UnityRequests, you can use the variable uploadProgress
to track the progress of a download, it is updated correctly for both download and upload operations.
Is that what you did @sayangel ? Glad the link helped you ! ;) Took me a while just to find it... !
@olafolafsson nevermind, figured it out! The suggested solution worked great, thanks :)
What was the solution? I cannot modify UnityMainThreadDispatcher.cs because it is a dll in aws-sdk-unity_3.3.359.0
Same here, UnityMainThreadDispatcher
is in a dll and how can I workaround it?
Hello dear friends, the same thing happened to me. I could not make the changes because they are now delivered in the form of .dll the AWS SDK. So, using the latest AWS SDK version of .NET (3.3.505.1), re-package it for unity by adding the changes to get the% progress of the download.
https://github.com/alejandroesteban/AWS_CUSTOM
or package
https://drive.google.com/file/d/1CFO01BrOqIeu97cDIzoBs5v1GL-AruHK/view?usp=sharing
It works in version 2019.1.0f2.
Try it and hopefully serve you like me!
Alexander
Thx @alejandroesteban,
I was about to use http download with Unity's WebRequest, but I guess it would require the buckets to be public, which sometime may not be the case I want...
I will give your suggestion a try first...
Hi! Thanks to @alejandroesteban I managed to get download progress working. But I can't figure out how to make upload progress work.
I also have an issue since importing @alejandroesteban's package, where I sometimes get this error when downloading files:
NullReferenceException: Object reference not set to an instance of an object
Amazon.Runtime.Internal.UnityMainThreadDispatcher+<InvokeRequest>d__11.MoveNext () (at D:/Downloads/aws-sdk-net-master/sdk/src/Core/Amazon.Runtime/Pipeline/_unity/UnityMainThreadDispatcher.cs:215)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
It works with the official AWSS3 package.
Tested on 2018.3.0f2 and 2019.1.2f1.
Would also love a fix for this!
Any updates ?
Is there an official feature request thread on aws forum for this, maybe to up vote or just +1.
Hi guys! Are there any updates on download progress callback for AWS Unity SDK (AmazonS3Client.GetObjectAsync)? or maybe someone has valid link/package for solution by @alejandroesteban (in his github project several dlls are missing, replacing them from original sdk will not work)?