Beispiel #1
0
        public void LocalVersionGetter(Action <DLLVersion> onLocalVersionGetted)
        {
            if (ILRuntimeScriptSetting.LoadDLLFromStreamingAssetsPath)
            {
                var localJsonFile =
                    StreamingAssetPath.CombinePath(
                        "AssetBundles/{0}/hotfix.json".FillFormat(AssetBundleSettings.GetPlatformForAssetBundles(Application.platform)));

                ObservableWWW.Get(localJsonFile).Subscribe(content =>
                {
                    var localVersion = content.FromJson <DLLVersion>();

                    onLocalVersionGetted(localVersion);
                });
            }
            else
            {
                var localJsonFile =
                    PersistentDataPath.CombinePath(
                        "AssetBundles/{0}/hotfix.json".FillFormat(AssetBundleSettings.GetPlatformForAssetBundles(Application.platform)));

                var localVersion = localJsonFile.LoadJson <DLLVersion>();

                onLocalVersionGetted(localVersion);
            }
        }
Beispiel #2
0
        IEnumerator DoDownload()
        {
            var savePath = PersistentDataPath.CombinePath("AssetBundles")
                           .CombinePath(AssetBundleSettings.GetPlatformForAssetBundles(Application.platform));

            savePath.DeleteDirIfExists();
            savePath.CreateDirIfNotExists();

            var fileNames = new string[]
            {
                "Android",
                "Android.manifest",
                "Android.manifest.meta",
                "Android.meta",
                "README.en.md",
                "asset_bindle_config.bin",
                "asset_bindle_config.bin.meta",
                "audio",
                "audio.manifest",
                "audio.manifest.meta",
                "audio.meta",
                "hotfix.dll",
                "hotfix.dll.mdb",
                "hotfix.dll.mdb.meta",
                "hotfix.dll.meta",
                "hotfix.json",
                "hotfix.json.meta",
                "shapes",
                "shapes.manifest",
                "shapes.manifest.meta",
                "shapes.meta",
                "uitetrispanel_prefab",
                "uitetrispanel_prefab.manifest",
                "uitetrispanel_prefab.manifest.meta",
                "uitetrispanel_prefab.meta",
            };

            foreach (var fileName in fileNames)
            {
                var www         = new UnityWebRequest(ServerHost + fileName);
                var persistFile = savePath.CombinePath(fileName);

                www.downloadHandler = new DownloadHandlerFile(persistFile);
                yield return(www.SendWebRequest());
            }
        }