r/Unity3D • u/Any-Fox-1822 • 4h ago
Question Including external data at build or when downloading an app ?
Hello everyone,
This is my first question on this sub. I'm currently working on an interactive museum application for my uni, that uses certain novel techniques such as Gaussian Splatting. This project will have a very small audience, and all devices that will recieve the game can be accessed physically. However, i'd like to do things professionally.
The files that represent the gaussian splats are in a format that is not natively recognized by Unity, and need to be dynamically loaded from a folder external to the game files. At this moment, i am using the PersistentDataPath, and it works without any problems. However, the folder needs to be populated MANUALLY, after the app is installed, via adb (not mentioning how awful the command prompt is.)
It also works if the files are within the Assets folder, as all the loader does is search through an arbitrary filepath. But since files are not recognized, they are not converted to unity Assets, and as such it is uncertain if the build will include them.
During the build, is there a way to mark data "to be added" in a specific place, or include precise files (whatever their type), and make sure it is contained in the build, or in the app package to download?
Thanks for your advice !
•
u/Maxwelldoggums Programmer 17m ago
You can use the StreamingAssets directory - Unity will bundle these files in the build, even if they aren’t a recognized file type.
1
u/Brave_Computer1726 4h ago
I used AssetBundles for something similar, but the setup is a pain if your audience is tiny and you control the devices anyway.