//加载streamingAsset下的配表信息 private bool LoadStreamingConfig() { var path = AssetBundlePathResolver.GetStreamingBundlePath(AssetBundlePathResolver.DependFileName); if (!UnityStreamingFileHelper.CheckStreamExistsFile(path)) { return(false); } var _xml = UnityStreamingFileHelper.GetStreamStringAllPlatform(path); return(ParseBundleConfig(_xml)); }
void Save() { AssetBundlePathResolver pathResolver = new AssetBundlePathResolver(); if (AssetDatabase.LoadAssetAtPath <AssetBundleBuildConfig>(savePath) == null) { AssetDatabase.CreateAsset(config, savePath); } else { EditorUtility.SetDirty(config); } }
private void ReadConfData(string fileName, IBaseConfig conf) { #if UNITY_EDITOR && !AB_MODE using (StreamReader sr = new StreamReader(Path.Combine(Application.dataPath, AssetBundlePathResolver.GetAssetPath(fileName)))) { conf.Initialize(sr.ReadToEnd()); } #else AssetBundleManager.Instance.LoadAssetSync(fileName, (abInfo) => { TextAsset asset = abInfo.Require(null) as TextAsset; if (null != asset) { conf.Initialize(asset.text); } }); #endif }
//加载streamingAsset下的配表信息 private bool LoadFileMapperConfig() { string cfgStr; //优先加载PersistentPath var patchXmlPath = AssetBundlePathResolver.GetBundleSourceFile(AssetBundlePathResolver.DependFileName); if (File.Exists(patchXmlPath)) { cfgStr = File.ReadAllText(patchXmlPath); } else { //加载FileMap var strBytes = FileMapper.GetFileBytes(AssetBundlePathResolver.DependFileName); if (strBytes == null || strBytes.Length == 0) { CommonLog.Error("初始化AB系统配置表失败"); return(false); } cfgStr = System.Text.Encoding.UTF8.GetString(strBytes).TrimEnd('\0'); } return(ParseBundleConfig(cfgStr)); }
public AssetBundleBuilder4x(AssetBundlePathResolver pathResolver) : base(pathResolver) { }
public AssetBundleBuilder5x(AssetBundlePathResolver resolver) : base(resolver) { }
public AssetBundleManager() { Instance = this; pathResolver = new AssetBundlePathResolver(); }
public WWWResourceManager() { pathResolver = new AssetBundlePathResolver(); }
public ABBuilder(AssetBundlePathResolver resolver) { this.pathResolver = resolver; this.InitDirs(); AssetBundleUtils.pathResolver = pathResolver; }
public AssetBundlePathResolver() { instance = this; }