Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Deploy text or config file in game build

Discussion in 'General Discussion' started by Makkus, Sep 30, 2019.

  1. Makkus

    Makkus

    Joined:
    Sep 14, 2015
    Posts:
    20
    Hi folks,
    I am looking for a solution to deploy plain text files (for game configuration) in the build (windows only). I have realized that some plugins to this (like SteamVR deploys the bindings...json file to the build root).
    I explicity do want the files to be user editable once the game is shipped. I know I could create assets from them, but then they can not be (easily) edited by the user. I rather like to have a file config.txt (or similar) somewhere inside the game folder.

    Any help would be appreciated-
    Greetings,
    Makkus
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    Any files inside Assets/StreamingAssets will be included as-is, with no processing. You can get at those files both in the editor and builds by using Application.streamingAssetsPath

    Docs
     
  3. Makkus

    Makkus

    Joined:
    Sep 14, 2015
    Posts:
    20
    Perfect! - I was guessing files in there would be packaged somehow (like the asset bundles) but plain files remain individual files - nice!
    Thanks, Baste!
     
  4. naviln

    naviln

    Joined:
    Oct 18, 2016
    Posts:
    32
    Champion, thanks!