Commit 6d424f0e authored by Unicorn369's avatar Unicorn369

fix path

parent a78608ab
......@@ -274,6 +274,9 @@ public class Program : MonoBehaviour
public static float verticleScale = 5f;
//YGOMobile Paths (https://github.com/Unicorn369/YGOPro2_Droid)
public static string Android_Path = "/storage/emulated/0/ygopro2/";
void initialize()
{
#if UNITY_EDITOR || UNITY_STANDALONE_WIN //编译器、Windows
......@@ -282,23 +285,18 @@ public class Program : MonoBehaviour
#elif UNITY_ANDROID //Android
Screen.sleepTimeout = SleepTimeout.NeverSleep;
//YGOMobile Paths (https://github.com/Unicorn369/YGOPro2_Droid)
//string GamePaths = "/storage/emulated/0/ygocore/";
//YGOPro2 Paths (https://github.com/Unicorn369/YGOPro2_Droid/tree/Test)
string GamePaths = "/storage/emulated/0/ygopro2/";
if (!File.Exists(GamePaths + "updates/version1.0.txt"))
if (!File.Exists(Android_Path + "updates/version1.0.txt"))
{
string filePath = Application.streamingAssetsPath + "/ygocore.zip";
var www = new WWW(filePath);
while (!www.isDone) { }
byte[] bytes = www.bytes;
ExtractZipFile(bytes, GamePaths);
ExtractZipFile(bytes, Android_Path);
//File.Create(GamePaths + ".nomedia");
}
Environment.CurrentDirectory = GamePaths;
System.IO.Directory.SetCurrentDirectory(GamePaths);
Environment.CurrentDirectory = Android_Path;
System.IO.Directory.SetCurrentDirectory(Android_Path);
#elif UNITY_IPHONE //iPhone
string GamePaths = Application.persistentDataPath + "/ygopro2/";
if (!File.Exists(GamePaths + "updates/version1.0.txt"))
......
......@@ -249,7 +249,7 @@ public class selectDeck : WindowServantSP
System.Diagnostics.Process.Start("gedit", path);
#elif UNITY_ANDROID //Android (https://github.com/Unicorn369/Unity_Android_Library)
AndroidJavaObject jo = new AndroidJavaObject("cn.unicorn369.library.API");
jo.Call("openFile", "/storage/emulated/0/ygopro2/" + path);
jo.Call("openFile", Program.Android_Path + path);
//#elif UNITY_IPHONE //iPhone
#endif
}
......
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