,Hi,
I have created a custom package with package.json, Runtime, Editor and Examples directory etc. I have added some example code like Canvas, GameObjects, Scripts etc. in the Examples directory so that consumers of the package can use the prefabs from Example directory.
I initially developed the package using its own unity project. When I developed the custom package, it was all under Assets folder so everything seems to work in its own unity Project.
I didn’t want to checkin the full-unity project in the git, just package itself to the git and needed to figure-out how to edit the package in Unity IDE in a separate unity project. I created a new unity project and imported the local git managed copy using UPM → Import Package from local disk. This seems to work as far as git is concerned because any changes that I make to the Unity project they are outside the git and changes made to the local package directory itself are git managed.
But the problem is that I get the error “Prefab has missing scripts. Open prefab to fix the issue”. It seems that since the script is in Example directory and not under the Assets directory, it can’t find the script.
What is the recommended way to develop custom package with Examples like? Does Import Package from local disk makes sense? If yes then how do I resolve the above issue? Do I need a asmdef file in the Examples directory?