Search Unity

Modifying packages and updating later

Discussion in 'Package Manager' started by emrys90, Jun 24, 2018.

  1. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    A common thing I have to do when installing assets I purchase on the store is to make a code change to them to fix a bug, or add in a new feature specific to my use case. As you can imagine, this now becomes difficult maintaining assets to be able to update them to a newer version because I have to reimplement every change I made. I was wondering if there's any plans for the new Package Manager to help alleviate this issue?
     
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @emrys90,

    Yes we have plan to improve this kind of use cases. We are implementing what we call *embedding packages*. Once a package is added to your project, you'll have the option to *embed* the package. This will effectively copy the package content under the *Packages/* folder for you. You'll get the best of both world. The package will still be isolated from you project but you can change and adapt the code. You can even change the dependencies if you want.

    Regards,

    Pascal
     
  3. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    How does this help with updating the asset later on, to not lose my changes?
     
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    If you source control your *embedded* package, you can embed the latest one, compare and merge with your own diff. But this is manual. Also, if you diverge your custom implementation too much, the challenge to update will be higher for sure. Ideally, in a perfect world, we would like users that make changes to push them upstream if they make sense to share with others. But we are not there yet...north star :)
     
  5. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    That requires storing it in a separate repo from the main project though, so that you can then switch back to the master branch and update. It's doable, but a lot of hassle to setup per asset. Was just hoping for something a bit more elegant, no clue how it would be possible though.
     
  6. tinyant

    tinyant

    Joined:
    Aug 28, 2015
    Posts:
    127
    I need intalled packages be local.modify them debug them like resources in the Assets folder.export to other projects as a normal package.If You make some changes you maybe bakeup your modify and merge to new update yourself.
     
  7. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    I terms or repo like git updating modified package can be done by PackageManager like that:
    1. determine all modifications made form current version of package
    2. put all of it onto shelf (like git stash command)
    3. revert all package content to current version
    4. update package normally
    5. apply changes from shelf opening merge tool for detected conflicts
     
    ROBYER1 and emrys90 like this.