示例#1
0
        //加载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);
        }
    }
示例#3
0
    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
    }
示例#4
0
        //加载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));
        }
示例#5
0
 public AssetBundleBuilder4x(AssetBundlePathResolver pathResolver) : base(pathResolver)
 {
 }
示例#6
0
 public AssetBundleBuilder5x(AssetBundlePathResolver resolver)
     : base(resolver)
 {
 }
示例#7
0
 public AssetBundleManager()
 {
     Instance     = this;
     pathResolver = new AssetBundlePathResolver();
 }
 public WWWResourceManager()
 {
     pathResolver = new AssetBundlePathResolver();
 }
示例#9
0
 public ABBuilder(AssetBundlePathResolver resolver)
 {
     this.pathResolver = resolver;
     this.InitDirs();
     AssetBundleUtils.pathResolver = pathResolver;
 }
 public AssetBundlePathResolver()
 {
     instance = this;
 }