wrong update editor window after www

Hi, when i send a request from editorwindow by www, the answer does not come until I move window.

EditorWindows aren’t constantly updated. The OnGUI function will only be called if something changes (user moves mouse over the window, you dragging the window).

That said are you sure that the www answer is the problem here? Maybe only the window isn’t redrawn so you won’t see any changes. You could try to force a repaint using the Repaint() method after your data has been received.

When i send www request, in consol doesn’t show anything.

request come just after Event.current.type == EventType.used.

Can you show us some code on how you are receiving the www request? I am currently suspecting you are directly using the standard www coroutine pattern inside ongui.

public void export(string token, string version)
{
string url = DOMEN + KEY_EXPORT + “?” + Time.deltaTime.ToString();
string data = “token=” + token + “&version=” + version;
StartCoroutine(POST(url, data, TypeConnect.export));
}

public IEnumerator POST(string url, string data, TypeConnect type)
{
byte[ ] rawData = Encoding.UTF8.GetBytes(data);
WWW www = new WWW(url, rawData);
yield return www;
if (!String.IsNullOrEmpty(www.error))
{
Debug.Log(www.error);:wink:
}
else
{
switch (type)
{

case TypeConnect.export:
if (!JSONHelper.parseBaseResponse(www.text))
{
SoftlationData.erroSyncMessage = JSONHelper.baseResponseMessage(www.text);:wink:
Debug.Log(SoftlationData.erroSyncMessage);
break;
}
//here i change my data
SoftlationData.updateExportData(www.text);:wink:
break;

}
}
}

Where is this code located? StartCoroutine is a method on monobehaviours so I suspect export is called on a monobehaviour sitting in the scene. By default I don’t think they are properly(coroutines executing) updated while not in play mode.

btw: use code tags. makes the code much more readable.

I have EditorWindow that created two gameobject. One of them is my data, another is to create request and he is child from first. When i get response i change fisrt gameobject data and i need that data changed in my EditorWindow.

Ok, so my current theory would be that coroutines aren’t updated as long as you are not in play mode. Should be quite easy to determine.

Some workarounds could be ExecuteInEditMode or manually rendering frames using the sceneview class. You should also be able to use WWW directly within the editorwindow without adding additional stuff to your scene by using editorwindow update and www.isDone.

Thanks, but does not work. if you can, maybe you give me your skype or something else, and i show you what wrong.