Hey guys.
I am working on a 3D hand interface program. I have an 3rd party .dll that I am using as an API to their program. The .dll relies on 3 folders containing txt files that are needed for the .dll to initiate. All works fine and dandy when testing as long as those folders containing the txt files are in the root of my project. However when I build, these txt files don’t follow along with the build. I have tried manually moving them to the root of my build, in the data folder and in other folders within the data folder to no avail.
How do I resolve this?
Put them in a Resources folder, such as Assets/Resources/.
I tried that. Still doesn’t work. Do you think it has to do with the pathing they use in their library to load files?
Sorry, I couldn’t say, not knowing what the library is. (Just curious - is this LeapMotion?) The text files are almost certainly being included in the build, since files in Resources folders are included in the build even if they’re not explicitly referenced at design time. So it sounds like the API just can’t find them. Would using Application.dataPath help?
Can you provide the data to the API as a string instead of a text file? If so, you could put the text files anywhere in Assets and assign them to a TextAsset variable in a script. Then just use TextAsset.text to get the string representation of the text file.
Yeah thats the problem I think, the way the API is designed I can receive data from it but not much else. I think the internal code I can’t see or access is attempting to load the files as if it were a regular application. I have no way of sending the file as a textAsset to the API or accessing any of the private methods to use Application.dataPath, guess Ill have to talk to the fellows who own the library.
Yeah its a 3rd party application that builds off the leap motion. So I guess that would make it 4th party? haha