hello
I’m not sure how PackageManager manages Pacakge
If the owner of the asset modifies only one code among the codes of the asset, then updates
Then, when someone else updates the asset, is only the code modified by the owner updated?
Or is the code of the entire asset updated?
I sometimes move Libary’s code to the Pacakge folder and modify it a bit.
Then, if the owner of the asset updates it, the asset I pulled into the Packger folder will not be updated.
So I modified only the part I needed and put it back in the Libary,
If you need an update later, after updating the asset, pull it back into the Package folder and ask if it would be possible to work on what I previously modified.
Things are a bit muddled here because with the inclusion of Assets Store packages into the package Manager you now have two distinct types of packages that can both be called ‘packages’ yet actually update differently.
So whilst you use the word ‘Asset’ in your post, the behaviour of moving packages from Library to Packages folder suggest you are talking about npm packages and not Asset packages.
Below are my thoughts based on my experience, though I’ve only explicitly tested some aspects of what I’ve written so may not be correct, or may have changed in more recent versions of the Editor.
So for npm packages, which are stored in say ‘AppData/Local/Unity/Cache’ and when installed via the PackageManager are by default placed into ‘Library/PackageCache’, but which can be moved into the ‘Project/Packages’ folder to create an ‘embedded package’ that can be edited. Then any updates for these will AFAIK completely replace the old package, assuming you have NOT embedded them. If they are embedded then I think updates are just ignored.
Asset Packages on the other hand are embedded into your project ‘assets’ folder and can perform in-place updates, but its rather limited so quite often you’ll find developers recommending that you delete the old asset folder from your project before updating. For simple assets is fine, its also useful if you want to revert any changes you might have made, but the more complex the asset, and the more complex the changes between one version and another the greater the chance of in-place updates screwing it up.
I don’t think this works since as soon as you open the Unity project, it will detect the package in the Library/PackageCache’ has changed and restore it to its previous state ( Unity assumes its corrupted ) - i.e. you will instantly lose your changes as Unity re-installs the package from the local machine cache.
Regardless even if it doesn’t then as npm packages completely replace the old contents you’ll lose your changes at that point anyway.
I’m unsure if there is a ‘proper’ method to do this, but my methods are;
For Asset Package, first try importing the update into the project, then check the ‘Import Unity Package window’ that opens. It shows new files and files that have updated or are different to the current installed version. If there are no conflicts with any modifications I’d made, or no conflicts that seem important I’ll import the assets.
If there are conflicts then I move to my second method which I also use for when I’ve ‘embedded’ npm package. In these cases I have a separate Unity project into which I can import the npm or assets packages that have changed, then use WinMerge ( on Windows ) to compare the npm package or asset package folders.
Then depending on the complexity of changes, either merge the new version packages into my existing project, or merge my changes into the new versions and then replace the old versions.