Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

AssetBundles and UCB

Discussion in 'Unity Build Automation' started by Avocco, Sep 2, 2016.

  1. Avocco

    Avocco

    Joined:
    Feb 2, 2015
    Posts:
    16
    Hi,
    We are using UCB with the *Build Asset Bundles* option set to YES in our project. We gave UCB's user write permissions to our repository (P4), but cannot find where the automatically generated assets bundles are stored. Would it be possible to have the assetbundles uploaded to our repository or at least get a link for downloading them?
    Thanks
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,555
    What platform are you building for ? when you select the "Build asset bundles" option, the build will create all asset bundles defined in your project. You have another option to store these under "Streaming assets".

    I have not found any documentation about what happens if you only select "build asset bundles" - where are these bundles stored ? and what is done with them ? this is not very clear.

    What i do know is that these are probably not committed back to your repository, even if the user running the build has write access.

    If you must achieve something like this, it may be possible using something like:

    1. Create a pre / post build step that will create all asset bundles, storing them on the build agent in a known folder location.
    2. Setup a build "notification" (docs here). Once a build completes (after asset bundles were built), your server will be notified and will receive a call with the relevant information. Your server will get the built data and commit that to source control.

    I have never used the notification system so i am not familiar with whether this can actually work or not ..

    *Thinking again, you may include a C# library that can interact with P4, and have that run as a post-build step (after building your asset bundles). This will automatically push changes to your P4 server. Again, i have never tried this, but who knows maybe it can spark some idea to help you achieve what you want :)
     
  3. Avocco

    Avocco

    Joined:
    Feb 2, 2015
    Posts:
    16
    Thanks,

    I solved the problem, for anyone who is trying to do this,
    Use a pre-export method for generate the bundles,
    Use a post-export method to compress the files and a httpwebrequest to submit to your custom server (do not use UnityWebRequest or WWW methods, will not work)

    For local testing of the methods use (this has to work properly):
    unity -quit -batchmode -executeMethod YourClass.YourMethod
     
  4. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    212
    Great, it was I am searching for. have you the code to send to your custom server under the hand?