Add quick fix for duplicate migration folder creation#25
Closed
shiyouganai wants to merge 1 commit intoPiMaker:mainfrom
Closed
Add quick fix for duplicate migration folder creation#25shiyouganai wants to merge 1 commit intoPiMaker:mainfrom
shiyouganai wants to merge 1 commit intoPiMaker:mainfrom
Conversation
This commit adds a quick fix for an issue where duplicate asset folders were created if a user migrated to the package version of LTCGI when there was already an LTCGI Controller in their open scene.
Owner
|
Mh, I think the better fix here would be to change that function to just use The empty duplicate folder thing even plagues UdonSharp, so this isn't a unique issue at least... |
Owner
|
This should be fixed in #26. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a hack fix for a small, arcane issue that I don't know the exact root cause of, but the symptom was that when I deleted my manually installed version of LTCGI tonight and migrated to the package install via github url, the scripts created a handful of empty, duplicate folders in my
Assetsdirectory.Steps to recreate bug:
Assets/folders but leave scene as-is, then reinstall packageThe function
MigratoryBirdsDontMigrateAsMuchAsWeDoButThisFunctionWillTakeCareOfItNonetheless(lol) is running multiple times and at least one subsequent invocation of the function beyond the first doesn't have itsAssetDatabase.IsValidFoldercalls returntrue, despite the folders existing.I don't know why. It may have something to do with the nature of the asset database: the result of the folder creation may not be available via the API until some later point, depending on when the API is used? (This is beyond my level of Unity expertise. I was led to that hypothesis after reading the "Asset Import Order" part of this doc.)
So I made sure those folders are only checked once per whatever interval Unity resets static variables. I also removed the manual database refresh because I think if you're just using the
AssetDatabaseAPI you don't need to manually refresh.If you know an actual not hack fix or just want to close this as a won't-fix, it's no big deal, but I figured I'd open it anyway!