Ejemplo n.º 1
0
 public void Dispose()
 {
     Validate();
     if (m_Data != null)
     {
         m_Data.Close();
         m_Data.Dispose();
         m_Data = null;
     }
 }
Ejemplo n.º 2
0
            public InternalOp <TObject> Start(IResourceLocation location)
            {
                Validate();
                m_Result     = null;
                Context      = location;
                m_Complete   = false;
                m_StartFrame = Time.frameCount;
                m_Data       = new ChunkedMemoryStream();
                CompletionUpdater.UpdateUntilComplete("WebRequest" + location.InternalId, CompleteInMainThread);
                var req = WebRequest.Create(location.InternalId);

                req.BeginGetResponse(AsyncCallback, req);
                return(this);
            }
Ejemplo n.º 3
0
            void InternalOp_completed(AsyncOperation obj)
            {
                Validate();
                ResourceManagerEventCollector.PostEvent(ResourceManagerEventCollector.EventType.LoadAsyncCompletion, Context, Time.frameCount - m_StartFrame);
                TObject result = null;

                if (obj is AssetBundleCreateRequest)
                {
                    result = (obj as AssetBundleCreateRequest).assetBundle as TObject;
                }
                SetResult(result);
                InvokeCompletionEvent();
                m_Data.Close();
                m_Data.Dispose();
                m_Data = null;
            }