In an inspector I’m invoking a Coroutine. When the Coroutine finishes I want the Editor to Repaint(). However, calling Repaint() from the Coroutine’s callback doesn’t Repaint(). Is there a simple solution to this that I’m missing?
Thanks,
In an inspector I’m invoking a Coroutine. When the Coroutine finishes I want the Editor to Repaint(). However, calling Repaint() from the Coroutine’s callback doesn’t Repaint(). Is there a simple solution to this that I’m missing?
Thanks,
the only way I’ve found to do this, consistantly, is to override the Editor’s RequiresContantRepaint function
eg
override public bool RequiresConstantRepaint() { return (repaintCondition1 || repaintCondition2); }
Wow, I love how I’m not good enough to comment on a reply in a thread I’ve started…
@Glurth, I’ve tried to override UnityEditor.Engine::RequiresConstantRepaint()
but that doesn’t get the update to occur. Which makes me think this isn’t the actual problem… I need to do more digging.
I will post what I find.
I’ve written a short workaround for how the Unity editor handles yield instructions within the editor space (shown below):
protected System.Collections.IEnumerator CoQuery()
{
bool bStillWorkingOnSomething = true;
#if UNITY_EDITOR
if (!Application.isPlaying)
{
while (bStillWorkingOnSomething)
{
/* When done doing what your doing... */
bStillWorkingOnSomething = false;
}
}
else
{
#endif // UNITY_EDITOR
yield return new WaitForSeconds(1); // Or something similar...
#if UNITY_EDITOR
}
#endif // UNITY_EDITOR
}
Hopefully, this can help someone in the future.