How can I access files next to executable?
Hey reading ... guy, how can i access files for example in a folder next to my executable while running.
Answer by FortisVenaliter · Aug 09, 2016 at 05:19 PM
Generally, you shouldn't. If you know you're only building to Windows, you can, but again, you shouldn't unless you have to. It's highly recommended to use Unity's build pipeline to ensure assets are distributed properly, work in a multi-platform environment, and you're not opening up your code to io hacks.
But if you insist, you can use the standard .NET IO library to do so, and you can use reflection to get the path of the currently executing assembly.
$$anonymous$$y question was a Bit unprecised: it doesnt has to be while running, loading at the Start of the exe is enough. I want to allow the User to add his own music easily.