-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMoveBinFile.cs
More file actions
35 lines (24 loc) · 879 Bytes
/
MoveBinFile.cs
File metadata and controls
35 lines (24 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using UnityEngine;
using System.Collections;
public class MoveBinFile : MonoBehaviour {
string filePath;// = System.IO.Path.Combine(Application.streamingAssetsPath, "bin.bin");
string destinationPath;// = System.IO.Path.Combine(Application.dataPath, "bin.bin");
// Use this for initialization
IEnumerator Start () {
filePath = System.IO.Path.Combine(Application.streamingAssetsPath, "bin.bin");
destinationPath = System.IO.Path.Combine(Application.persistentDataPath, "bin.bin");
if (filePath.Contains ("://")) {
WWW www = new WWW (filePath);
yield return www;
System.IO.StreamWriter writer = new System.IO.StreamWriter (destinationPath);
writer.Write (www.bytes);
writer.Close ();
} else {
System.IO.File.Copy (filePath, destinationPath, true);
}
Debug.Log ("xxx");
}
// Update is called once per frame
void Update () {
}
}