Commit ca0d2529 authored by Unicorn369's avatar Unicorn369

自动下载并解压数据包(Test)

parent ff3fa082
fileFormatVersion: 2
guid: 3e7316faecb66ab489c7d71f8991b1d5
timeCreated: 1549612020
guid: dd03a7ceb4d913346bec9c982c0174f7
timeCreated: 1549876658
licenseType: Free
PluginImporter:
serializedVersion: 2
......
......@@ -393,16 +393,16 @@ public class Program : MonoBehaviour
loadResources();
#if UNITY_ANDROID //Android Java Test
AndroidJavaObject jo = new AndroidJavaObject("cn.unicorn369.library.UnityAndroid");
if(!File.Exists("updates/image_version1.0.txt"))//用于检查更新
{
if(File.Exists("pics.zip"))//YGOMobile内置的卡图包
{
AndroidJavaObject jo = new AndroidJavaObject("cn.unicorn369.library.UnityAndroid");
jo.Call("doZipExtractor", "pics.zip", "./");
jo.Call("doExtractZipFile", "pics.zip", "./");
File.Create("updates/image_version1.0.txt");
} else {
AndroidJavaObject jo = new AndroidJavaObject("cn.unicorn369.library.UnityAndroid");
jo.Call("doDownLoad", "http://192.168.1.222:3690/pics.zip", "./");
//jo.Call("doDownloadFile", "https://github.com/Unicorn369/YGOPro2_Data/releases/download/0.1/ygopro2-data.zip", "./");//下载不解压
jo.Call("doDownloadZipFile", "http://download.ygopro.win/ygopro2/Android-Image-Data.zip");//下载并解压,完成后删除
}
}
#endif
......
......@@ -812,20 +812,20 @@ public class GameTextureManager
if (!File.Exists(path) && pic.code != 0)
{
//YGOMobile (177x254)
df.Download("http://android.ygopro.win/YGOMobile/pics/" + pic.code.ToString() + ".jpg", "expansions/pics/" + pic.code.ToString() + ".jpg");
df.Download("http://download.ygopro.win/ygopro/pics/" + pic.code.ToString() + ".jpg", "expansions/pics/" + pic.code.ToString() + ".jpg");
path = "expansions/pics/" + pic.code.ToString() + ".jpg";
}
#endif
if (!File.Exists(path) && pic.code != 0)
{
//YGOPro2 (421x614)
df.Download("http://update.ygopro.win/ygopro2-data/picture/card/" + pic.code.ToString() + ".jpg", "picture/card/" + pic.code.ToString() + ".jpg");
df.Download("http://download.ygopro.win/ygopro2/picture/card/" + pic.code.ToString() + ".jpg", "picture/card/" + pic.code.ToString() + ".jpg");
path = "picture/card/" + pic.code.ToString() + ".jpg";
}
if (!File.Exists(path) && pic.code != 0)
{
//YGOPro2 pre(336x490)
df.Download("http://update.ygopro.win/ygopro2-data/expansions/pics/" + pic.code.ToString() + ".jpg", "picture/card/" + pic.code.ToString() + ".jpg");
df.Download("http://download.ygopro.win/ygopro2/expansions/pics/" + pic.code.ToString() + ".jpg", "picture/card/" + pic.code.ToString() + ".jpg");
path = "picture/card/" + pic.code.ToString() + ".jpg";
}
if (!File.Exists(path))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment