public void Dispose() { Validate(); if (m_Data != null) { m_Data.Close(); m_Data.Dispose(); m_Data = null; } }
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); }
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; }