Search Unity

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

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

How to make changes to Asset Store Assets Update-Proof

Discussion in 'Scripting' started by BloodHound92, Nov 4, 2015.

  1. BloodHound92

    BloodHound92

    Joined:
    Dec 21, 2013
    Posts:
    42
    Hello Everybody,

    I have been juggling with an issue recently. I want to make changes to some code belonging to an asset I bought off an asset store. The problem is that I want to make my changes update-proof. Meaning that when I update the asset in the future to a new version, my changes will not be overwritten.

    The only thing I can think of is to make a separate class of any class I want to make a change to. Then I would override any methods which I want to change. The only problem is that this can be kind of messy and might require a lot of refactoring of components to use the new classes that I create.

    Please let me know if you have any solutions to this predicament.

    Thank you,
    BloodHound92
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,796
    Version control. Put the original asset in a repo. Make all of your changes in a branch. Then when the asset is updated, you can make a branch for that update and then merge it back in.
     
    BloodHound92 likes this.
  3. BloodHound92

    BloodHound92

    Joined:
    Dec 21, 2013
    Posts:
    42
    Thanks @BoredMormon that sounds like exactly what I am looking for. I do have one question because my Version Control skills are not quite up to snuff. What if you had multiple assets to make changes to. Would you create a different branch for each asset and merge the branches in separately when updates occur?
     
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,796
    I would probably make a separate repo for each asset. But I don't have that much experience in projects with a high amount of asset store content.
     
    BloodHound92 likes this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,936
    This is more of a longer-term suggestion, but petition those Asset Store developers to make their code extensible with events, delegates, interfaces, virtual members, and the like, so you don't have to touch their code directly. Or find replacement products that are already built with this kind of extensibility in mind. In the long run, it'll make life easier for you and them.
     
    BloodHound92 likes this.
  6. BloodHound92

    BloodHound92

    Joined:
    Dec 21, 2013
    Posts:
    42
    That is true @TonyLi . If asset store developers created their content with that mindset, it would be easy as cake to additions to their code.
     
  7. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,530
    Agreed. Does the asset store have a document for new unity asset store creators to help them to think in this fashion? Something like "Design for sales and success: making integration easy with extensible unity assets"
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,936
    Not that I'm aware of, but that's a great idea. I wonder if we could crowdsource one. I just started the topic here.
     
unityunity