I’m having an issue getting my package to compile when I add it to a project in 2019.1
I have a package that contains classes that provide extended functionally for time line.
I have added the Timeline package as a dependency, but unity fails to compile my package as it cannot find the UnityEngine.Timeline namespace, although it is present as its own package.
Any idea on how to solve this issue?
Edit : I’ve tried to upgrade the original project I used to create the package to 2019, and the code there won’t compile either, seems as if the UnityEngine.Timeline namespace is completely inaccessible even from regular scripts in 2019.1
One thing to consider: packages use assembly definition files. You might need to include the timeline asmdef from your project in order to access the timeline APIs. You can find details on asmdef here: Unity - Manual: Assembly definitions
Oh that makes sense. I didn’t setup the ASMDef file in my own ASMDef. that solved the issue. thank you.
On a side note, that is a bit of a confusing issue. I assumed that by adding a package as a dependency it will essentially “import” it into my package. The asmdef thing wasn’t clear to me. Could be that I missed that in the docs, or it could be that the docs aren’t clear on that. This should probably be highlighted more clearly, as more and more people move to use packages in their projects.
Indeed, it is a new concept in Unity, one we could document better.
In retrospect, what would have been a good place for you to “discover” you had to do that?
I guess in the Concepts page of the packages, or anywhere in the packages section of the manual, perhaps in the dependencies page, under another section?