예제 #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;
        }
예제 #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;
        }