Exemplo n.º 1
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                unityWebRequest.Dispose();
                unityWebRequest = null;

                ErrorReceived.RemoveAllListeners();
                ErrorReceived = null;

                DownloadInProgress.RemoveAllListeners();
                DownloadInProgress = null;

                DownloadCompleted.RemoveAllListeners();
                DownloadCompleted = null;

                ExceptionCaught.RemoveAllListeners();
                ExceptionCaught = null;
            }

            disposed = true;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UnityHttpClient"/> class.
        /// </summary>
        public UnityHttpClient()
        {
            ErrorReceived      = new ErrorReceivedEvent();
            DownloadInProgress = new DownloadInProgressEvent();
            DownloadCompleted  = new DownloadCompletedEvent();
            ExceptionCaught    = new ExceptionCaughtEvent();

            unityWebRequest = new UnityWebRequest();
            AutoDispose     = true;
        }
Exemplo n.º 3
0
        public void ExceptionCaught(ExceptionCaughtEvent caughtEvent)
        {
            this.buttonId++;
            var element = caughtEvent.Element;

            element.AppendChild(this.ExpectedSpan(element));
            // Special handling for <a> tags to avoid the stack-trace being inside the link text
            if (element.IsNamed("a"))
            {
                var div = new Element("div");
                element.AppendSister(div);
                element = div;
            }
            element.AppendChild(this.ExceptionMessage(caughtEvent.CaughtException.Message));
            element.AppendChild(this.StackTraceTogglingButton());
            element.AppendChild(this.StackTrace(caughtEvent.CaughtException, caughtEvent.Expression));

            this.EnsureDocumentHasTogglingScript(element);
        }
Exemplo n.º 4
0
 public void ExceptionCaught(ExceptionCaughtEvent caughtEvent)
 {
     this.m_Events.Add(caughtEvent);
 }