Hi everyone,
I’m just startet getting started with custom Unity Packages. I spend the day and finally deployed my first custom package to github and importing it also works well.
At first I thought it wasn’t working, because I couldn’t get access to the classes and components on my local project with the physical package inside (hence the “in development” tag in the package manager).
But when I started a new project I was able to import and use the package.
So now I’m asking myself how would I extend my package, work on it, troubleshoot and test if I can only get access to it when in dev mode and only use it when importing it in another project?
Is there something I am missing?
Side question: I saw something about putting github information in the package.json …I didn’t do it and it works just fine, is there a need to specify anything, or why is there an option for that?
Hope you can help me to better understand it 
Well, just after opening the project back up I was able to access the package content even in development mode.
Which is strange because I did that several times before. I guess I have to look further into what caused that.
So the first question seems to be solved then.
I’m still trying to find a good solution to work on the packages. Maybe I will just create a Unity project to work on my packages and have them as seperate git repositorys in the Packages folder.
You can have your development project commit to Git as well. Since UPM Git supports referencing package inside a folder. See “path” in Unity - Manual: Git dependencies.
But a local development repository + separated package Git repository also works fine.
See some good practices at How to Maintain UPM Package Part 1 | by Favo Yang | OpenUPM | Medium
Alright cool, but I guess having all packages as a separate repo works best for me. The article also looks like something that I could get back to 
I just set up a new local repository in a unity project solely for developing and testing the first package. And again I can’t access anything. I don’t know whats going on here.
Intellisense wasn’t working as-well until I enabled:
Unity –> Preferences –> External Tools –> Generate .csproj for: –> Embedded packages
Yet I’m not able to access the package in the base Unity Project. Even the namespace is not recognized, this is strange, it’s of course a basic requirement that I can access the code to use and test it.
Yessir.
If I add the exact same package to a new project via git it works.
Only not in the working project with the embedded package :S
Edit: I can even use the package components and attach them to GameObjects. I only can’t reach the package via script for some reason…
Weird, not sure where to go, probably try some random things.
- Run “Package Validation Suite” (a UPM package, install it, re-open package manager UI, click the “Validate” button.
- Check out the package git directly into the Packages folder.
- Create another even clean package to test out.
- Check Editor.log.
Hm, the only relevant error I see is the Manifest Validation:
Failed - "ChangeLog Validation"
Error: Cannot find changelog at '/Users/Shared/Unity/MyPackages/Packages/Homemade Studios Utility/CHANGELOG.md'. Please create a 'CHANGELOG.md' file and 'CHANGELOG.md.meta'. Read more about this error and potential solutions at https://docs.unity3d.com/Packages/com.unity.package-validation-suite@latest/index.html?preview=1&subfolder=/manual/changelog_validation_error.html%23cannot-find-changelog
Failed - "License Validation"
Error: Every package must have a LICENSE.md file. Read more about this error and potential solutions at https://docs.unity3d.com/Packages/com.unity.package-validation-suite@latest/index.html?preview=1&subfolder=/manual/license_validation_error.html%23every-package-must-have-a-license-file
Failed - "Documentation Validation"
Error: Your package must contain a "Documentation~" folder at the root, which holds your package's documentation.
Failed - "Manifest Validation"
Error: In package.json, "name" needs to start with one of these approved company names: com.unity., com.autodesk., com.havok., com.ptc.. Read more about this error and potential solutions at https://docs.unity3d.com/Packages/com.unity.package-validation-suite@latest/index.html?preview=1&subfolder=/manual/manifest_validation_errors.md%23name-needs-to-start-with-one-of-these-approved-company-names
But its odd, because my package name is: "name": "com.homemade-studios.utility"
Should the package appear in the manifest.json in the Package folder root? Because its not. But maybe thats normal with embedded packages.
Edit: I found out that the function calls indeed compile and work, but only Visual Studio doesn’t recognize it. So this seems to be no problem with the package itself.
Still stumped what to look out for. These are not my type of problems
Okay, new findings:
I removed the
Unity –> Preferences –> External Tools –> Generate .csproj for: –> Embedded packages
flag again and the errors went away. However now I don’t have intellisense again when working on my package. It’s a chicken-and-egg problem at this point.
I think since this is getting out of hand and doesn’t really has something to do with the package manager anymore, I will abandon this Thread 
Thanks for the help so far, also the validation stuff, all nice to know facts!
1 Like