NativeTrees icon indicating copy to clipboard operation
NativeTrees copied to clipboard

samples restructuring

Open Thendon opened this issue 1 year ago • 4 comments

The samples contain conflicting Asset UIDs for some projects which can not be fixed by the Unity Editor automatically when importing Packages with git. The problem can by fixed by restructuring the files according to this documentation: https://docs.unity3d.com/6000.0/Documentation/Manual/cus-samples.html

Thendon avatar Nov 10 '24 12:11 Thendon

Samples will be importable in the Package Manager menu: image

Thendon avatar Nov 10 '24 12:11 Thendon

Sounds good, but when I open the project the Samples~ folder is completely invisible inside of the Unity editor. How do you edit the samples should the need arise?

bartofzo avatar Nov 16 '24 14:11 bartofzo

Yea I later also figured that this setup may be ideal for my situation but not so much if you don't use the package manager like I am. When using my pull request the workflow of changing sample scripts would be something like:

  • Importing those samples from the package manager menu. Now you have a copy of everything in your main projects /Asset folder which shouldn't be tracked by git
  • Change those sample scripts
  • Copy all changed files back into the special Samples~ folder I can imagine that this would become kind of annoying and prone to mistakes, maybe there is a better way which I don't know of.

Thendon avatar Nov 16 '24 14:11 Thendon

I use a standard dummy project and then make a symbolic or hard link to the package content and the ~Samples folder (renamed without the ~ in the link process). It yells at you when starting up but other than that it works great and I can easily make changes to the package + samples and push them to the relevant branch when ready. No need for duplicate copies.

Ph0t0nX avatar Nov 17 '24 21:11 Ph0t0nX