Is it possible to store assets used in a Unity game (2D or 3D) in the database? I think it is less efficient but want to have single source of truth and maybe have the game contact the database everytime it loads to get the new updates.

  • \$\begingroup\$ I assume that with "the database" you mean any generic SQL database? \$\endgroup\$
    – Philipp
    Jan 7 '17 at 13:02
  • \$\begingroup\$ "Single source of truth" makes me think this a distributed application. You might want to clarify. \$\endgroup\$
    – Anko
    Jan 7 '17 at 13:20
  • \$\begingroup\$ yes generic SQL for example SQL Server Express. Yes I work for consultancy and my client is two offices of architects working on the same compound \$\endgroup\$ Jan 7 '17 at 13:32

First, storing large binary data in a database rarely ends well. Even if it works well at first just wait for backup and replication issues.

If you want a central source of truth for your files you can use a content delivery server/network. This way you can update your files and use the usual file backup and replication strategies.

Either way, Unity can download asset bundles from a server. If you chose to store your assets in a DB you will have to provide an HTTP server to let unity download the files.

Then once you have started deploying your assets you can use WWW to download your assets as stated here https://docs.unity3d.com/Manual/DownloadingAssetBundles.html

  • \$\begingroup\$ wow thank you that is exactly what i was looking for \$\endgroup\$ Jan 7 '17 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.