Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Deploying source files of packages instead of DLL form

Discussion in '2018.2 Beta' started by Kronnect, Apr 28, 2018.

  1. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,894
    Hi,

    The Package Manager in 2018.1 is a nice addition however I’d prefer it to deploy the packages in plain/original source format when possible. That will enable modding the local installation with some editor extensions.

    For instance the PPS package comes now compiled and out of reach from Editor which is a pity since it’s also available on Github and in that form it allows more flexibility.

    Thanks.
     
    ferretnt and Lars-Steenhoff like this.
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    yes if thats the pecident it creates, i have little hope for when the assetstore packages are allowed to use the packagemanager. because they would all be dll's without source. what would be nice to have an option for each compiled to dll package to have a link to its source code somehow. be it github or just a zip file.
     
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    That is not what is happening here.

    Packages are still being downloaded to your computer in source form. But these source files are living in a central package cache on your computer, rather than being copied to the Assets folder of each of your projects that uses them, or the Packages folder in the root of your project.

    So you can still see the source of the assets. If you want a local copy you can manually copy the required package folders from the cache to the Packages folder within the root of your project folder. It would be nice if the Package Manager gave me the option to do this per package. But as best I can tell it works ok if you do it manually. I believe you can probably copy it to your Assets folder instead if thats what you really want/need for some reason.

    Also Unity are adding the ability to browse Package contents in the unity editor but if I remember correctly this is in 2018.2 beta not 2018.1
     
    tswierkot and Lars-Steenhoff like this.
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Also, see the following post from a week ago. It is now clear Unity intend to allow people to 'embed' a package and this is the same thing as I was talking about doing manually in my last post:

    #2
     
  5. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    And I know Thrawn75 already knows about the following thread, but I should mention a post from it here for others because it contains the paths for the package cache:

    #7
     
  6. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    And just to attempt to clear up the last bit of confusion - why dlls mentioned in this thread?

    Its understandable that, upon not seeing anything but dlls for the post-processing present anywhere your project folder, you might think that the package manager is directly responsible for putting those modules there in dll form only.

    But actually the reason you see these packages in dll form is due to work unity did previously, that whole Assembly Definition File thing, which is also being applied to packages. With that advantage that by compiling different parts of a projects source code to a range of different managed assemblies, less stuff needs to be recompiled every time you make a change to a script file in another part of the system. So assuming I've got the right end of the stick, you will find that there end up being separate post-processing dll files made in your project folder no matter how you add the source code to your project (old ways of putting into assets folder, manually into project package folder, or auto via package manager UI where currently no source files are actually copied into project folder). Those dlls will be rebuilt if you edit any of the post-processing scripts, but not every time you edit some of your other code.

    https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html
     
    Lars-Steenhoff likes this.
  7. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,894
    Thanks @elbows. Reason for preferring the source files instead of DLLs is that we can have smart editor extensions that mods sources and keep those modifications to inject functionality and produce different results and compilation schemes.

    For instance, in Beautify you can strip certain shader features based on the inspector settings. It’s not just setting some material/shader keywords but modifying the source files automatically to optimise compilation time and include/exclude certain shader features without abusing keyword slots (all the keywords stuff needs a review IMO and I think Unity has some plans for this but this is another story).

    You can still benefit from assembly definition files so Unity can still compile each package in different DLLs or even put the packages in the old good plugins folder to avoid rebuilds.

    Btw, I’m not sure if the central repository of the Package Manager cares about versioning per project. I mean if project A uses version 1.1 of the Package and project B uses version 2.0 ... does it keep corresponding versions in the central caché? That’s not what the Asset Store subsystem does and definitely it could benefit from a multi-version caché approach provided by the Package Manager.
     
    Lars-Steenhoff likes this.
  8. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I cant tell whether this means you didnt get what I was trying to explain in previous posts, or something else. There are no lack of source files with the package manager, its just that as the system works right now they stay in the cache and arent copied. But your unity project is still accessing the source files, unity is setup now to be able to read these files as if they are in your project and creating dlls etc just like it would if the source files were actually in the project folder rather than just being referenced. And they plan to allow this copying (embed) function at some point, if you want to have a modified local copy for a project, and we can copy files to do it ourselves manually in the meantime.

    Yes, the cache contains multiple versions of the various packages, they go in the cache when any project uses them and stay there. And the manifest file allows you to specify which version of a package you want to use, eg you could edit that file yourself rather than have package manager UI update it.
     
    Lars-Steenhoff likes this.
  9. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @Thrawn75 ,

    @elbows answers are all correct.

    Note that we want to expose packages source to our community as much as we can.

    Thank you @elbows for you answers. This is really helpful :)

    Regards,

    Pascal
     
    Lars-Steenhoff and elbows like this.