I am trying to export a Godot game to Android using C#. I am using external libraries, like onnxruntime and everything seems to work except for the fact that I cannot include custom files to the exported package. I have already tried to include custom files using Godot's built in resources tab in the export dialog. More specifically, I have added *.txt and *.onnx as extensions to be included. However, only .txt files are exported and recognized. I can get a .txt file by using the res:// location, but other files cannot be found, because they "don't exist". So, how can I access custom files? Where do I have to place them and how do I reference them? Is there a library I have to install? Do I have to fiddle with the AndroidManifest or gradle files? I am using Godot 3.5, Visual Studio Code and .NET 6.0. Any help is appreciated.
At first I tried to change the extension of the files into .res in order to trick the system into accepting them. However, while the files could be seen by Godot, importing and using them proved to be tricky. Instead I used Godot's File functionality after I had declared the extensions that I wanted to use in the resources tab, in the Export dialog. This code works:
var f = new Godot.File();
f.Open(m_path, Godot.File.ModeFlags.Read);
res = f.GetBuffer((long)f.GetLen());
f.Close();
I have not figured out why the path res://[filename.extenion] returns no results though.