protected virtual void OnDownloadComplete()
 {
     m_save = new AssetBundleSaveOperation(AssetManager.downloadAssetPath, name, m_request);
     AssetManager.instance.StartCoroutine(m_save.DoSave());
 }
        public bool Update()
        {
#if UNITY_EDITOR
            if (type == LoadType.Simulate)
            {
                return(false);
            }
#endif

            if (state == LoadState.Preparing)
            {
                Request();
            }

            if (state == LoadState.Downloading)
            {
                if (UpdateDownload())
                {
                    return(true);
                }
                if (type < LoadType.Load || isError)
                {
                    m_request = null;
                    if (m_save != null)
                    {
                        m_save.dispose = true;
                    }
                    m_save = null;

                    return(false);
                }

                state  = LoadState.Loading;
                m_load = AssetBundle.LoadFromMemoryAsync(m_request.downloadHandler.data);
            }

            if (state == LoadState.Loading)
            {
                if (UpdateLoad())
                {
                    return(true);
                }

                if (m_save != null)
                {
                    m_save.dispose = true;
                }
                m_save = null;

                if (type < LoadType.LoadAsset || isError)
                {
                    m_request = null;
                    return(false);
                }

                state     = LoadState.Processing;
                m_process = m_assetName == null?asset.LoadAllAssetsAsync(m_assetType) : asset.LoadAssetAsync(m_assetName, m_assetType);
            }

            if (state == LoadState.Processing)
            {
                return(UpdateLoadAsset());
            }

            return(false);
        }