Search Unity

Apply the modification of a prefab in game from a bundle

Discussion in 'Scripting' started by SMGPRo, Jun 4, 2019.

  1. SMGPRo

    SMGPRo

    Joined:
    Apr 26, 2019
    Posts:
    1
    Hello, I would like to add an component to a prefab and apply the modification for save it into the bundle in game (during run-time).
    It is possible ?
    Prefab in bundle
    ->add a component to the prefab
    ->apply modification of the prefab
    ->save it in the bundle

    Thank you in advance.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    No, you'll have to save your changes elsewhere and then apply them the next time you load the bundle.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Yeah, what @StarManta said... if you're looking for an easy-cheesy way to hot-patch your asset bundles while testing, just make a loader function that loads it, patches it, and then returns the newly patched object to you for your testing.