Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Customizing the Metadata script

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

  1. DriesVrBase


    Mar 24, 2020

    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,
  2. DavidMenard


    Unity Technologies

    Jun 3, 2019
    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!
    DriesVrBase likes this.
  3. DriesVrBase


    Mar 24, 2020
    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!