Example #1
0
        /// <summary>
        /// 更新资源
        /// </summary>
        /// <param name="files"></param>
        /// <returns></returns>
        private IEnumerator UpdateAssets(List <string> files)
        {
            Debug.Log("开始更新资源");
            progress = 0f;
            foreach (var item in files)
            {
                string     fileUrl    = resUrl + "/" + PlatformUtil.GetPlatformName() + "/" + item;
                Downloader downloader = new Downloader(resDir, fileUrl);
                yield return(downloader.Download());

                progress += 1f / files.Count;
            }

            File.WriteAllText(configPath, newConfigTxt);
        }
Example #2
0
 public override void OnSingletonInit()
 {
     if (PlatformUtil.IsEditor())
     {
         defaultSaveDir = "D:/Unity3dProjects/MiniFramework/Assets";
     }
     else if (PlatformUtil.IsPC())
     {
         defaultSaveDir = Application.streamingAssetsPath;
     }
     else if (PlatformUtil.IsPhone())
     {
         defaultSaveDir = Application.persistentDataPath;
     }
 }
Example #3
0
        public ResourceLoad(LoadType loadType)
        {
            this.loadType = loadType;
            switch (loadType)
            {
            case LoadType.FromEditor:
                break;

            case LoadType.FromStreamingAssets:
                resDir = Application.streamingAssetsPath;
                break;

            case LoadType.FromPersistentPath:
                resDir = Application.persistentDataPath;
                break;
            }
            resDir    += "/" + PlatformUtil.GetPlatformName();
            configPath = resDir + "/config.txt";
        }
Example #4
0
 public ResourceUpdate()
 {
     resDir     = Application.persistentDataPath + "/" + PlatformUtil.GetPlatformName();
     configPath = resDir + "/config.txt";
 }