Search Unity

Resolved How to edit Build-in Packages as Custom Package

Discussion in 'Package Manager' started by digital-void, Oct 19, 2021.

  1. digital-void

    digital-void

    Joined:
    May 7, 2018
    Posts:
    8
    We are currently working with Unity 2021.2b - and need to modify some UI-Builder sources.

    Before we switched to beta - uielements has been a Preview Package - so we could move it into the Packages folder and edit it easily.
    However inside the beta it's now part of Unity and doesn't even state its version number.
    upload_2021-10-19_11-14-16.png

    Normally I'd just copy the sources from package cache - but there is no _version_ and I don't think that it is the last published prev. version, because there are bugs fixed in the build-in version that exist in the last preview package.
    The only thing that I could come up with was to look into the unity editor sources - but there them darn packages are all build into .dlls ...
    upload_2021-10-19_11-24-6.png


    So where can I find the sources of a build-in package to include it manually - or is there another way?

    At the end a suggestion: How about to add a button that makes any installed package - automatically a custom one?
    Wouldn't it just to move it into the projects package folder, remove version suffix and recompile? Maybe auto add the original version number and creation / clone date into description...
    This is probably more or less an expert setting - so hide it by default and put a checkbox into "Advanced Project Settings"
    That there might be breaking changes when unity is updated - sure - but as it's an expert setting - one who makes that claim should be able to address that issue if it arises ;) . for eg. create git patch and re-customize it again... etc...

    -- -- --
    To preempt the question - why would one event want to edit a build-in package -
    I guess that there are many reasons why that would be necessary in a long running project.
    Our demand at hand is the incomplete inspector implementation in the ui-builder.
    https://forum.unity.com/threads/custom-ui-builder-attribute-fields.945491/
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    That might come in handy one fine day.

    We know the Unity package server has failed before and it will fail in the future, so a feature like the above would come in handy.

    I would make a stub project once every few months, link all the packages I regularly about, hit the MAKE CUSTOM button to get them into
    Assets
    , commit them and have a handy backup and reference.
     
  3. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    It is still possible to embed built-in packages.

    They can be found in the following paths:

    Windows
    <path-to-unity-installation-dir>\Data\Resources\PackageManager\Server\BuiltInPackages

    Mac
    <path-to-unity-installation-dir>/Unity.app/Contents/Resources/PackageManager/BuiltInPackages


    About the lack of version problem, you are correct. We believe almost all of the built in packages have as version `1.0.0` at the moment, these packages become unversioned, which is a limitation we need to find a solution.
     
    Kurt-Dekker likes this.
  4. digital-void

    digital-void

    Joined:
    May 7, 2018
    Posts:
    8
    @UnityMaru Thanks for the solution!
    Probably you could add this information to the docs .... idk - maybe here:
    https://docs.unity3d.com/2021.2/Documentation/Manual/upm-embed.html

    Regarding the version number of a build-in-package - is there any other way to figure it out?
    Maybe it's possible to find it in an included text file or online somewhere?
    Because, the main reason why one would copy a package is to change something in the code.
    But without knowing if something has changed by a version number, the only way would be a manual code compare - which is possible of course - but not really good practice...
     
  5. digital-void

    digital-void

    Joined:
    May 7, 2018
    Posts:
    8
    @UnityMaru sorry to bother you again - but - eh - in the server folder - there is only a NodeJS exe and that's it:
    upload_2021-11-17_17-49-33.png
    However there is a path to the BuildInPackages - but only a few of them contain actual code - most just have the package.json
    C:/Program Files/Unity/Editor/Data/Resources/PackageManager/BuiltInPackages/
    upload_2021-11-17_17-56-24.png
    So - what now?