Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Customizing the Metadata script

Discussion in 'Unity Reflect' started by DriesVrBase, Aug 24, 2021.

  1. DriesVrBase

    DriesVrBase

    Joined:
    Mar 24, 2020
    Posts:
    40
    Hi,

    I'm currently working on a tool to view some buildings.
    I want to extend the Metadata class so I can add some more tools to the script.
    For instance I have a 'ChangeParameter' function that searches for a key in the metadata script and you have to pass along a certain string value, this function then changes the value from the key you passed along, to the desired value you entered somewhere else.
    But once I change the Metadata script and let it recompile in Unity it just sets it back to the original script. (because it is in the reflect namespace/package probably).

    Is there a way to turn this off? Or do I need to create a new script that copies the metadata to a new dict and then use this script to alter everything? Seems like a lot of work for a small change so I was wondering if there is an easier way.

    Kind regards,
    Dries
     
  2. DavidMenard

    DavidMenard

    Unity Technologies

    Joined:
    Jun 3, 2019
    Posts:
    103
    Hey Dries!
    I'm by no means an expert on this, so I'll try and help the best I can. This is pretty much how packages will behave throughout Unity, not just Reflect, so that things stay up-to-date and consistent.
    The way around this is to embed a copy of the package in you project, then remove the dependency in Package Manger. This can be done by looking in your Library/PackageCache folder and just grabbing the package you want to change from there.

    Hope this helps!
    David
     
    DriesVrBase likes this.
  3. DriesVrBase

    DriesVrBase

    Joined:
    Mar 24, 2020
    Posts:
    40
    Hi David,

    Thanks for the help! I tried it yesterday already by making a copy, removing the package from the package manager and then selecting 'upload package from disk'. That did the trick :)

    Thanks again!
     
unityunity