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; }
/// <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; }
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); }
public void ExceptionCaught(ExceptionCaughtEvent caughtEvent) { this.m_Events.Add(caughtEvent); }