Simulate slower WWW download?

Is there a way to slow down the download via WWW? I tried network emulation but that is not working.

Also is there a way to get the filesize of my download or do I have to write that in a text file for instance next to the file? I talk about an assetBundle that I download.

Here is what i did and it seems to be correct:

    using (WWW www = new WWW(path))
        {
            while (!www.isDone)
            {
                DownloadProgress = www.bytesDownloaded;
                float v = www.progress <= 0 ? 0.0001f : www.progress;
                Filesize = (int)(DownloadProgress / v);
             
                if (www.error != null)
                {
                    CurrentDownloadState = EDownloadState.Error;
                    break;
                }
                yield return null;
            }
[...]
}

You could try downloading Fiddler (Download Fiddler Web Debugging Tool for Free by Telerik)

When you run it go to Rules->Performance and select ‘Simulate Modem Speeds’.

Also, you can normally get the filesize from the WWW response headers (Unity - Scripting API: WWW.responseHeaders)

1 Like

You can use network traffic debugger for that.
If you are on Windows, you can use Fiddler. It lets you monitor the the requests and you can also set delays, simulating slow network.
There are such tools of OSX too.

1 Like