public async Task LoadAsync() { if (File.Exists(_localPath)) { try { _abManifest = JsonUtility.FromJson <AbManifest>(File.ReadAllText(_localPath)); } catch (System.Exception e) { Debug.LogError( $"{GetType()}/UpdateAsync() failed to read AbManifest file, please check it! Error Message: {e}"); return; } } else { return; } if (File.Exists(_manifestLocalPath)) { var abCreateRequest = AssetBundle.LoadFromFileAsync(_manifestLocalPath); await abCreateRequest; var assetBundle = abCreateRequest.assetBundle; var abManifest = _abManifest; abManifest.manifest = assetBundle.LoadAsset(AbDefine.assetbundleManifest) as AssetBundleManifest; _abManifest = abManifest; } }
public async Task <AbUpdateMode> CheckUpdateAsync() { await DownloadFileAsync(_remotePath, _tempPath); if (!File.Exists(_localPath)) { return(AbUpdateMode.Force); } if (File.Exists(_tempPath)) { _abManifest = JsonUtility.FromJson <AbManifest>(File.ReadAllText(_localPath)); var temp = JsonUtility.FromJson <AbManifest>(File.ReadAllText(_tempPath)); if (temp.version > _abManifest.version) { return(AbUpdateMode.Remind); } } return(AbUpdateMode.None); }
public MultiAbLoader(AbManifest abManifest) { _loaders = new Dictionary <Hash128, AbLoader>(); _relations = new Dictionary <Hash128, AbRelation>(); _abManifest = abManifest; }