Load and wait for file from Streaming Assets(synchronous load)?

Hi, I’m trying to load a file from the streaming assets folder and need the app to wait till it’s loaded. On other platforms this is doable by using something like this :

WWW loadFile = new WWW(path);
while(!loadFile.isDone){
System.Threading.Thread.Sleep (5);
}

On WebGL this will block the single thread and will never return.
There does not seem to be a way to do this, which seems really weird, since it is possible to use Resources.load() which loads and returns the result.

Is there any other way besides using Resources.load()?
Any help Will be greatly appreciated.

There must be some way to synchronously load files… right?

are you using this?
https://bitbucket.org/Unity-Technologies/assetbundledemo

I am just trying to synchronously load a single file on the WEBGL platform, that file is part of the deployed project. I don’t want to create an asset bundle or anything.

WWW blocks for me when loading texture, but doesnt when loading text (it seems).

Unity WebGL is single-threaded at the moment so that’s expected. Have you tried using a coroutine?

im using coroutine, here is my code BELOW. Just create a new scene with a cube and attach the code below to it. Then run it in WebGL in a browser (same thing happens even in the editor actually).

You can see the slight hiccup because the cube stops spinning when the texture is being downloaded by the CoRoutine.

This is loading just ONE texture and you can already see a hiccup, but my real code is loading maybe 10 of them or more at the same time at various times in the game, it causes a BIG freeze of the whole game, player may be running and then freeze in mid run, its very annoying.

using UnityEngine;
using System.Collections;

public class SpinCube : MonoBehaviour {
bool busy = false;

void Start()
{
FetchPic();
}

void FetchPic()
{
if (!busy) {
StartCoroutine(GetPic());
}
Invoke("FetchPic", 1.0f);
}

IEnumerator GetPic()
{
busy = true;
var www = new WWW("https://starscenesoftware.com/test/pic.png");
yield return www;
gameObject.GetComponent<Renderer>().material.mainTexture = www.texture;
busy = false;
}

void Update()
{
transform.Rotate(new Vector3(Time.deltaTime * 10, Time.deltaTime * 30, Time.deltaTime * 20));
}
}