Try this:
using UnityEngine;
using System;
using System.IO;
public class filebrowser : MonoBehaviour {
void ProcessFolder(string f) {
Debug.Log("Folder: " + f);
var txtFiles = Directory.GetFiles(f);
foreach (string currentFile in txtFiles) {
Debug.Log("File: " + currentFile);
}
string[] subs = Directory.GetDirectories(f);
foreach(string sub in subs)
ProcessFolder(sub);
}
// Use this for initialization
void Start () {
ProcessFolder(Application.dataPath);
}
// Update is called once per frame
void Update () {
}
}
Drop that onto your camera, then when the game starts up it'll iterate over the folder and subfolders from the Application data folder, and show you what is actually on the device. You can then use this to determine whether your asset is actually getting copied onto the phone or not. If it is there, then it would be odd to get a error when you try to access the file.
My results look like:
Folder: /var/mobile/Applications/{GUID}/test.app/Data
File: /var/mobile/Applications/{GUID}/test.app/Data/PlayerConnectionConfigFile
File: /var/mobile/Applications/{GUID}/test.app/Data/mainData
File: /var/mobile/Applications/{GUID}/test.app/Data/sharedassets0.assets
File: /var/mobile/Applications/{GUID}/test.app/Data/unity default resources
Folder: /var/mobile/Applications/{GUID}/test.app/Data/Managed
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/Assembly-CSharp.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/Assembly-UnityScript.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/Assembly-UnityScript.dll.mdb
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/Boo.Lang.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/Mono.Security.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/Mono.Security.dll.mdb
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/System.Core.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/System.Core.dll.mdb
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/System.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/System.dll.mdb
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/UnityEngine.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/mscorlib.dll
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/mscorlib.dll.mdb
Folder: /var/mobile/Applications/{GUID}/test.app/Data/Managed/mono
Folder: /var/mobile/Applications/{GUID}/test.app/Data/Managed/mono/2.0
File: /var/mobile/Applications/{GUID}/test.app/Data/Managed/mono/2.0/machine.config
Folder: /var/mobile/Applications/{GUID}/test.app/Data/Raw
File: /var/mobile/Applications/{GUID}/test.app/Data/Raw/test.txt
Note at the bottom of that list, you can see that there is a file called `test.txt` in the `Raw` folder. That `test.txt` is there because it exists in the `StreamingAssets` folder in my Unity project.
↧