Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feedback Dependencies for samples

Discussion in 'Package Manager' started by Micz84, Jan 8, 2021.

  1. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    436
    I am playing around with custom packages and I am missing one feature or I can't make it work.
    My small custom package has minimal dependencies, and I would like to provide a usage example as a sample. But it will need another package not needed by the package itself. It would be nice to be able to define it in package.json.
     
    vladmirsouza, C-H-a-P and JesOb like this.
  2. UnityMaru

    UnityMaru

    Community Engagement Manager Unity Technologies

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Hey there,

    It's currently not possible to do that but we're aware of the limitation.

    The best workaround for now is to create a separate package for the sample that has a dependency on the main package and the extra dependencies needed for the sample, in order to avoid adding those unnecessary dependencies to the main package.
     
    C-H-a-P likes this.
  3. AliCanKeskin

    AliCanKeskin

    Joined:
    Jun 7, 2022
    Posts:
    17
    Any Updates on this, I would like to be able to create a dependency to another package if they import the sample
     
    amokto and vladmirsouza like this.