Bool returns different values in Update and OnGUI

Hello, i’m having a problem that’s giving me headache :

when i check the value of a bool in Update, it returns False, but in OnGUI i get a True. Here’s the code which contains different variables i added for checking the returns, among which the int “count” that only counts up to 139 then stops for some reason.

    public class LoadGallery : MonoBehaviour {
        public Params pars = null;
        public List<GameObject> galleryObjectsToSpawn = null;
        public GameObject[] galleryFrameworksToSpawn = null;
        private GameObject[] galleryObjects = null;
        private WWW tmp = null;
        private bool replaced = false;
        private string output = null;
        private string done = null;
        private int count = 0;
    
	void Start () {
        Debug.Log("Starting");
        pars = (Params)FindObjectOfType(typeof(Params));
        foreach (var item in galleryObjectsToSpawn)
        {
            if (Instantiate(item) == null)
                Debug.Log("Error : couldn't create " + item.name);
        }
        galleryObjects = new GameObject[galleryFrameworksToSpawn.Length];
        GameObject obj;
        for (int i = 0; i < galleryFrameworksToSpawn.Length; i++)
        {
            if ((obj = (GameObject)Instantiate(galleryFrameworksToSpawn*)) == null)*

Debug.Log("Error : couldn’t create " + galleryFrameworksToSpawn*.name);*
else
{
galleryObjects = obj;
StartCoroutine(pars.GetAssetBundle(pars.Country + “.unity3d”));
StartCoroutine(pars.GetTexture(“Mini/” + pars.Country + “/” + pars.Country.ToLower() + “_” + (i + 1).ToString() + “__main_mini.jpg”, obj));
}
}
Debug.Log(“Done”);
* }*

void Update()
{
if (tmp == null)
{
tmp = pars.Assets[pars.Country + “.unity3d”];
output = tmp.url;
}
else if (tmp.isDone && !replaced)
{
for (int i = 0; i < galleryObjects.Length; i++)
{
galleryObjects*.renderer.material.mainTexture = (Texture2D)Instantiate(tmp.assetBundle.Load(pars.Country.ToLower() + "" + (i + 1).ToString() + “__main.jpg”));
_galleryObjects.transform.Rotate(new Vector3(0, 0, 45));*

output = (i + 1).ToString() + " - " + galleryObjects*.renderer.material.mainTexture;*
}
//tmp.Dispose();
//pars.Assets.Remove(pars.Country + “.unity3d”);
replaced = true;
}
if (tmp != null)
{
done = tmp.isDone.ToString();
count += 1;
}
}

void OnGUI()
{
if (tmp != null)
{
if (tmp.isDone)
GUI.Label(new Rect(0, 100, 500, 25), "Done loading the images " + tmp.isDone + " and replacing " + replaced + " count " + count);
else if (tmp.error != null)
GUI.Label(new Rect(0, 100, 500, 25), tmp.error);
else
GUI.Label(new Rect(0, 100, 500, 25), (tmp.progress * 100).ToString() + “%”);

}
if (output != null)
GUI.Label(new Rect(0, 200, 500, 25), output);
if (done != null)
GUI.Label(new Rect(0, 225, 500, 25), done);
}
}
The bool giving different results is tmp.isDone. On every try it shows the “Done loading the images” message, but won’t go into the loop to place them on the objects.
Also, i use another script for downloading bundles :
private Dictionary<string, WWW> abDic = new Dictionary<string, WWW>();

public Dictionary<string, WWW> Assets
{
get { return abDic; }
}

public IEnumerator GetAssetBundle(string url)
{
WWW ab;
abDic.Add(url, (ab = new WWW(url)));
yield return ab;

}
the dictionary being private is to avoid it being showed in the Editor.
Does anyone have an idea as to why the bool is returning different values?

So, not sure if it’s being drowsy this morning or due to fatigue but i totaly missed the big line in the middle of the loop :

StartCoroutine(pars.GetAssetBundle(pars.Country + ".unity3d"));

Since it’s the hihg quality images assetBundle, calling it’s downloading more than once is weird, and pretty taxing on the system. After i moved it out of the loop the bool went back to giving correct values. What i don’t understand is why it worked in the editor. Anyway, if anyone else got this problem, it might be the same case as mine.