Search Unity

Question Custom package with sample with additional dependancies

Discussion in 'Package Manager' started by WAYNGames, Jul 23, 2020.

  1. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    Hello,

    I'm working on a custom package and put in place some samples for it.
    My pacakge depends on other packages like enitties but I don't need anything in regard to rendering.
    Owerver, I would like to add some visual elements to my sample so I want the samples to use hybrid renderer and vfx graph.

    How can I define the depednacy on the sample without changing the package's own dependancies ?

    I pretty sure I saw somewhere an option to make the sample into a distinct package (to limit the import size) but I can't find it anymore... I hoped to use that to add the dependancy to the package.json of the sample.
     
  2. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    556
    Hi @WAYN_Group,

    It's currently not possible to add dependencies to a package and have them only considered then the samples from that package are imported. However you can create a separate package that contains only your samples, and has all the required dependencies (including a dependency on your main custom package). That Samples package would need to be added manually to the project by users. The steps to manually create package samples can be found here: https://forum.unity.com/threads/samples-in-packages-manual-setup.623080/