|
@@ -43,6 +43,8 @@ namespace GFGGame
|
|
|
int index = Application.persistentDataPath.IndexOf("Android");
|
|
|
path = index < 0 ? path : Application.persistentDataPath.Substring(0, index);
|
|
|
|
|
|
+ path = "/sdcard/DCIM/";
|
|
|
+
|
|
|
#endif
|
|
|
//判断目录是否存在,不存在则会创建目录
|
|
|
if (!Directory.Exists(path))
|
|
@@ -63,7 +65,7 @@ namespace GFGGame
|
|
|
Debug.Log("文件路径:" + path);
|
|
|
Texture2D tex = this.viewData as Texture2D;
|
|
|
byte[] bytes = tex.EncodeToPNG();//将纹理数据,转化成一个png图片
|
|
|
- File.WriteAllBytes(path + fileName, bytes);
|
|
|
+ File.WriteAllBytes(path + "/" + fileName, bytes);
|
|
|
Timers.inst.StartCoroutine(GetSaveState(path));// ();
|
|
|
// string[] paths = new string[1];
|
|
|
// paths[0] = path;
|