/// <summary>
        /// 初始化
        /// </summary>
        /// <param name="loadType"></param>
        /// <param name="useCache"></param>
        public static void Init(AssetsLoadType loadType, bool useCache)
        {
            if (s_isInit)
            {
                return;
            }

            s_isInit = true;

            if (loadType == AssetsLoadType.AssetBundle)
            {
                useCache = true;
            }
            if (!Application.isPlaying)
            {
                useCache = false;
            }
            UseCache = useCache;
            ResourcesManager.m_loadType = loadType;
            ReleaseAll();
            //GameInfoCollecter.AddAppInfoValue("AssetsLoadType", loadType);

            loadAssetsController = new AssetsLoadController(loadType, useCache);
            //Debug.LogError("ResourceManager初始化 AssetsLoadType:" + loadType + " useCache:" + useCache + loadAssetsController==null);
        }
示例#2
0
 public AssetsLoadController(AssetsLoadType loadType, bool useCache)
 {
     m_loadType = loadType;
     m_useCache = useCache;
     if (loadType == AssetsLoadType.Resources)
     {
         loader = new ResourcesLoader(this);
     }
 }
示例#3
0
 public AssetsLoadController(AssetsLoadType loadType)
 {
     this.loadType = loadType;
     if (loadType == AssetsLoadType.Resources)
     {
         loader = new ResourcesLoader(this);
     }
     else
     {
         loader = new AssetBundleLoader(this);
     }
 }
 /// <summary>
 /// 获取加载路径
 /// </summary>
 /// <param name="bundleName"></param>
 /// <returns></returns>
 public static string GetLoadPath(AssetsLoadType assetsLoadType, string path)
 {
     //string path = GetResourcePath(name);
     if (assetsLoadType == AssetsLoadType.Resources)
     {
         return(path);
     }
     else
     {
         return(GetLoadPathBase(assetsLoadType, path));
     }
 }
示例#5
0
        public static string GetLoadPath(AssetsLoadType assetsloadType, string name)
        {
            string path = string.Empty;

            if (assetsloadType == AssetsLoadType.Resources)
            {
                path = GetAbsolutePath(ResLoadLocation.Resource, name);
            }
            else
            {
                path = GetAssetsBundlePersistentPath() + path;
            }
            return(path);
        }
示例#6
0
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="loadType"></param>
    /// <param name="useCache"></param>
    public static void Initialize(AssetsLoadType loadType, bool useCache)
    {
        //if (isInit)
        //    return;

        if (loadType == AssetsLoadType.AssetBundle)
        {
            useCache = true;
        }
        if (!Application.isPlaying)
        {
            useCache = false;
        }
        UseCache = useCache;
        ResourceManager.loadType = loadType;
        ReleaseAll();
        loadAssetsController = new AssetsLoadController(loadType, useCache);
        //Debug.Log("ResourceManager初始化 AssetsLoadType:" + loadType + " useCache:" + useCache);
    }
示例#7
0
    public static string GetLoadPathBase(AssetsLoadType assetsloadType, string path)
    {
//#if !UNITY_WEBGL

        bool            isLoadByPersistent = RecordManager.GetData(HotUpdateManager.c_HotUpdateRecordName).GetRecord(path, "null") == "null" ? false : true;
        ResLoadLocation loadType           = ResLoadLocation.Streaming;

        //加载路径由 加载根目录 和 相对路径 合并而成
        //加载根目录由配置决定
        if (isLoadByPersistent)
        {
            loadType = ResLoadLocation.Persistent;
            return(PathTool.GetAssetsBundlePersistentPath() + path);
        }
        else
        {
            loadType = ResLoadLocation.Streaming;
            return(PathTool.GetAbsolutePath(loadType, path));
        }

//#else
//        return PathTool.GetLoadURL(config.path + "." + c_AssetsBundlesExpandName);
//#endif
    }
示例#8
0
 /// <summary>
 /// TodoAssetBundle资源加载
 /// </summary>
 /// <param name="assetsloadType"></param>
 /// <param name="path"></param>
 /// <returns></returns>
 public static string GetLoadPathBase(AssetsLoadType assetsloadType, string path)
 {
     return("");
 }
 private void InitLoadType()
 {
     loadType       = Application.platform == RuntimePlatform.WindowsEditor ? AssetsLoadType.Resources : AssetsLoadType.AssetBundle;
     loadController = new AssetsLoadController(loadType);
 }