Hi,
I am working on a HoloLens2 project where I have to access a file. In my unity project, I usually keep the file in StreamingAssets folder and can easily access it from the editor. But when I try to access the file for UWP, I don’t get any output in HoloLens.
string folderPath = Application.streamingAssetsPath;
#if UNITY_EDITOR
var files = Directory.GetFiles(folderPath);
if (UnityEngine.Windows.File.Exists(files[0]) && (files[0].Contains(".bin")))
voxel = File.OpenRead(files[0]);
#elif UNITY_WSA
var files = new[]{folderPath + "/file_name.bin"};
if (UnityEngine.Windows.File.Exists(files[0]) && (files[0].Contains(".bin")))
voxel = File.OpenRead(files[0]);
I can see the output in HoloLens when I specify the file name. That is what I am trying to avoid.
It would be helpful if you could suggest how to read files in UWP