My game is reading the following image, and this works fine when running in the editor:
filePath = Application.dataPath + "/Resources/next.png";
bytes = System.IO.File.ReadAllBytes(filePath)
But when I run from the Build, I’m getting the following error:
IsolatedStorageException: Could not find file “D:\LabRendererVR\BuildAndDestroyVR\BuilderBox_Data\Resources\next.png”
I can understand why the error is happening, because the file with the above path does indeed not exist. My understanding is that all Resources get bundled up in the “resources.assets” file.
Is it not valid to read file data using the ReadAllBytes example above? Or perhaps I need to (somehow) read this image from the “resources.assets” file? I’m not sure how to do this.
Does someone know how I can work through this issue?