public class FileExtracter : MonoBehaviour {
private string srcFile = "criware_movie.usm";
private string dstPath = "/storage/emulated/0/dst.usm";
IEnumerator Start() {
string srcPath = Path.Combine(Application.streamingAssetsPath, srcFile);
WWW www = new WWW(srcPath);
Debug.Log("Copy " + srcPath + " to " + dstPath + " is started.");
yield return www;
System.IO.FileStream fileStream =
new System.IO.FileStream(dstPath,
System.IO.FileMode.Create,
System.IO.FileAccess.Write);
fileStream.Write(www.bytes, 0, www.bytes.Length);
fileStream.Close();
Debug.Log("Complete");
}
}