Search Unity

Making sure all file changes are cached / converted

Discussion in 'Asset Bundles' started by SD_Unity, Aug 3, 2018.

  1. SD_Unity

    SD_Unity

    Joined:
    Mar 5, 2018
    Posts:
    103
    Is there a way to make sure all files that have been modified to be picked up by Unity before a call to BuildPipeline.BuildPlayer executes?

    I have a case where I need to modify a file that's used depending on a custom build option from the menus, unfortunately, this means I have to do two builds as Unity doesn't see the file changes in time for the first build (caching?)

    So is there any functions / options that can be called to make sure all files are in sync before a build is actually invoked?
     
  2. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
    try
    AssetDatabase.Refresh()
     
    SD_Unity likes this.
  3. SD_Unity

    SD_Unity

    Joined:
    Mar 5, 2018
    Posts:
    103
    That did the trick, well, with AssetDatabase.Save() beforehand as well as I was changing the PlayerSettings.

    Thanks.