static bool WaitForUpdate(ref bool isDone, int timeout, bool errorOnTimeout = true) { s_Stopwatch.Reset(); s_Stopwatch.Start(); do { AssetStoreClient.Update(); Thread.Sleep(10); if (AssetStoreClient.LoginError()) { Debug.LogError("Found Login error: " + AssetStoreClient.LoginErrorMessage); break; } if (!isDone && s_Stopwatch.Elapsed.TotalSeconds > timeout) { if (errorOnTimeout) { throw new TimeoutException("Asset Store batch mode operation timed out."); } break; } } while (!isDone); return(isDone); }
private static void WaitingForLogin() { if (s_LoginDone == false) { if (AssetStoreClient.LoginError()) { Debug.LogError("Found Login error: " + AssetStoreClient.LoginErrorMessage); CurrentState = State.Error; return; } if (s_Stopwatch.Elapsed.TotalSeconds > s_LoginTimeout) { Debug.LogError("Asset Store batch mode operation timed out."); CurrentState = State.Error; } } else { CurrentState = State.GetMetadata; } }