|
@@ -37,7 +37,7 @@ namespace GFGGame
|
|
|
string path = Application.persistentDataPath;
|
|
|
|
|
|
#if UNITY_ANDROID
|
|
|
- path = path + "/万世镜";
|
|
|
+ path = Application.persistentDataPath.IndexOf("Android") > 0 ? path.Substring(0, Application.persistentDataPath.IndexOf("Android")) : path + "/Pictures/万世镜";
|
|
|
#endif
|
|
|
//判断目录是否存在,不存在则会创建目录
|
|
|
if (!Directory.Exists(path))
|
|
@@ -50,6 +50,8 @@ namespace GFGGame
|
|
|
Debug.Log("文件路径:" + path);
|
|
|
Texture2D tex = this.viewData as Texture2D;
|
|
|
byte[] bytes = tex.EncodeToPNG();//将纹理数据,转化成一个png图片
|
|
|
+
|
|
|
+ // string path = Application.persistentDataPath.Substring(0, Application.persistentDataPath.IndexOf("Android"));
|
|
|
File.WriteAllBytes(path, bytes);
|
|
|
Timers.inst.StartCoroutine(GetSaveState(path));// ();
|
|
|
}
|