I’ve decided to title it as “Feedback” because it’s more of an knowledge thing, rather than actual direct help on the code.
Does Application.dataPath handle all the work related to picking what location the code needs to look for in order to access the assets when compiled for a particular platform, or are there any caveats that you need to know? I’ve looked around and i found that some reported that System.IO doesn’t work the same on all platforms because of how the platforms handle file storage (e.g Android).
Currently my code uses Application.dataPath + whateverfilename i need to access and it works fine, but how robust is that solution if i want to compile my project for various platforms?
Sorry if my question is way too broad, any input is appreciated!
To load assets from your project DO NOT USE System.IO at all. Doing so almost certainly means that it will only work on your PC, not on iOS and certainly not on Android.
Either drag a reference into the scene directly (with a public field), or else use Resources.Load() with the correct pathing and location. Read the docs for how to use that properly.
If for some bizarre reason you need to load raw data, put it in the StreamingAssets folder. Read the docs for how to use that properly.
Greetings again, Kurt and thank you for your quick answer! I suspected that something is wrong there so i decided to kind of steer away from using it for now. Thanks for the tips, i’ll look into the documentation. While the question can be considered resolved already, i’ll keep it as it is just in case so more input on the issue can be collected