Search Unity

How to make changes to Asset Store Assets Update-Proof

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

  1. StenBone

    StenBone

    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,860
    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.
     
    StenBone likes this.
  3. StenBone

    StenBone

    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,860
    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.
     
    StenBone likes this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    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.
     
    StenBone likes this.
  6. StenBone

    StenBone

    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,551
    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:
    12,706
    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.