Search Unity

Creating custom packages with dependencies on local scripts

Discussion in 'Package Manager' started by jakobkilian, Apr 15, 2020.

  1. jakobkilian

    jakobkilian

    Joined:
    May 7, 2017
    Posts:
    1
    Hey dear community,

    after reading the docu and the forum for over a day now I would like to ask a question.

    I want to create an embedded custom package (myPckg) in projA located in the /packages folder and reuse these scripts in projB, projC, ... located in sibling directories.
    I successfully build up this structure, added the jsons and the asmdefs. Everything works fine and I can resuse the scripts in all projects as long as I use simple, independent test code (like Debug prints).

    Here's the problem: myPckg will contain dependencies to scripts and purchased items located in the /Assets folder of the projects. So I added .asmdef files at the concerned locations and added them to my "Assembly Definition References" of the .asmdef of myPckg. So far so good; the compiler is able to find the scripts.
    But now I get tons of type or namespace name ... could not be found errors, as the project is huge and many of these scripts again depend on many others (many of them 3rd party purchased items) that they are seemingly not able to locate when they get called from "outside".

    Is there a way to tell myPckg to look for all dependencies as if it would be located in the /Assets folder?

    Hope my question is understandable. I can provide more information about system and logs if needed, but I thought this is more a question about structure and design for now... My Unity Version is 2019.3.8f1

    best wishes, and thx for your efforts.