Search Unity

How to edit registry package scripts?

Discussion in 'Scripting' started by FeastSC2, Apr 23, 2021.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    How can I modify scripts inside of a registry package?

    (I'm not talking about the usual downloade assets from the Asset store but registries that are added in the manifest.json file of the project)
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    If they're downloaded from a registry, they're assumed to be immutable. If you change them, those changes will be discarded.

    You can find the files and copy the package to your packages folder to have a local copy instead, but then they're not registry packages anymore, if that's a problem.

    I'm pretty sure the packages gets copied to your Library's packagecache, so that's where you'd copy it from.
     
    Joe-Censored and FeastSC2 like this.
  3. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978

    Thanks :)

    Another question: how can I reference a class of my other scripts in the package scripts?

    upload_2021-4-24_15-54-10.png
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    You can't reference your general code from packages, the dependency is the other way around.

    If this is general purpose code, you can extract it into a package and reference it from your package, but if that's a good idea or not very much depends on your project!
     
    FeastSC2 likes this.