Search Unity

Question How To change Text Mesh Pro Script without it Reversing

Discussion in 'UGUI & TextMesh Pro' started by Mortalanimal, Jun 19, 2020.

  1. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568
    Hi, I am in the process of making an asset that requires me to add / change some details in TMP original drop down script. But I noticed that after I made a new projects, those changes in my other project where I made the changes to TMP where reversed.

    Almost like unity decided to fix corrupted code

    Is there a way to resolve this? Many thanks
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Packages are stores in the Global Cache and then also present in the local project library folder. Whenever you close and reopen Unity, the package is sync with the Global Cache which is why your changes are overwritten.

    The only way to override a package is to embed it in the Packages folder of the project but this is unlikely to be a workable solution for your use case.
     
  3. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568

    thank you for your reply, the changes I made are small, Such as making some functions "public". Would embedding it be ok? Also I am trying to make this into an asset and upload it onto the store, am I allowed to make such changes? these changes shouldn't break TMP.

    If it is allowed, is there a way for me to auto embed it as someone installs the asset?
    Currently I was just going to make a YouTube video as a guide on what to change from TMP script.

    Thanks in advance
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The embedding process is a manual process. Even through it might be possible to create a script that could do that, I do not think the AssetStore team would approve that so I would recommend consulting with them on this.

    In terms of your changes, what methods are you changing and for what purpose?
     
  5. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568

    Thank you for your reply

    I am making "ImmediateDestroyDropdownList();" public, to bypass the co-routine

    And I am tagging the "Blockers" on creations, to limit their amount to "1 Max" at any given time.

    Atm those are the only changes I have made
     
  6. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568
    How do I go about doing that?

    I tried changing it from: "E:\Unity Projects and Saves\Search TMP Asset\Library\PackageCache\com.unity.textmeshpro@2.0.1\Scripts\Runtime" but that doesnt fix it. which means this is what you meant by the "local project library folder", but how do I find it in "Global Cache", How do I go about embedding it in "Packages folder of the project" weather by code or manually.

    Thanks in advance, I have finished the asset, this is all I have left to do.
     
  7. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568
    NVM I learned how to do it manually, I just need to learn how to automate it, and by automate it, I mean add 2 buttons, one to inject, and one to reverse the change.