private void AuthenticationResponseReceived(AsyncOperation asyncOperation)
        {
            AuthInProgress = false;

            UnityWebRequestAsyncOperation webOperation = (UnityWebRequestAsyncOperation)asyncOperation;

#if UNITY_2020_2_OR_NEWER
            if (webOperation.webRequest.result == UnityWebRequest.Result.ProtocolError || webOperation.webRequest.result == UnityWebRequest.Result.ConnectionError)
#else
            if (webOperation.webRequest.isHttpError || webOperation.webRequest.isNetworkError)
#endif
            {
                Debug.LogError("Unable to authenticate with deltaDNA API: " + webOperation.webRequest.error);
            }
            else
            {
                string jsonResponse = webOperation.webRequest.downloadHandler.text;
                DeltaDnaApiAuthResponse response = JsonUtility.FromJson <DeltaDnaApiAuthResponse>(jsonResponse);
                AuthToken = response.idToken;
                UpdateCacheToken();
            }

            // State of the main window has now changed, so force a repaint to ensure it doesn't wait before updating.
            _parentWindow.Repaint();
        }
Ejemplo n.º 2
0
        private void EventCreationFailed()
        {
            _mode = Mode.Create;

            _parent.Repaint();
        }
Ejemplo n.º 3
0
        private void ParameterCreationFailed()
        {
            _mode = Mode.Create;

            _parent.Repaint();
        }