Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaroud when AssetDatabase.CreateFolder failed #543

Merged
merged 2 commits into from
Sep 30, 2022

Conversation

chkuang-g
Copy link
Collaborator

With certain version of Unity, ex. 2022.2.0b8 or 2023.1.0a11, AssetDatabase.CreateFolder() can fail when the folder name is version number like 9.0.0. In this case, the API does not return empty guid but a guid with zeroes.

This change make sure that the folder can still be created using Directory.CreateDirectory(), which may not trigger AssetDatabase refresh in the older version of Unity.

With certain version of Unity, ex. 2022.2.0b8 or 2023.1.0a11,
`AssetDatabase.CreateFolder()` can fail when the folder name is version
number like `9.0.0`. In this case, the API does not return empty guid
but a guid with zeroes.

This change make sure that the folder can still be created using
`Directory.CreateDirectory()`, which may not trigger AssetDatabase
refresh in the older version of Unity.
@vangogih
Copy link

vangogih commented Sep 30, 2022

@a-maurice @DellaBitta hey, it's some critical bug. @CheeryLee investigated that problem and find out that it's unity bug and it reproduces in most 2022+ unity versions his message.

@chkuang-g chkuang-g merged commit ad55ee6 into master Sep 30, 2022
@chkuang-g chkuang-g deleted the patch/createfolder-fail branch September 30, 2022 15:05
chkuang-g added a commit that referenced this pull request Oct 4, 2022
Follow up for #543. When Unity failed to create folder using Unity API
`AssetDatabase.CreateFolder()`, even with the workaround in #543, Unity
would still generate two error message and there is no way to turn it
off.

This change add an additional log after Unity API fails to inform the
user to ignore this error.
chkuang-g added a commit that referenced this pull request Oct 5, 2022
* Add log when Unity failed to create folder

Follow up for #543. When Unity failed to create folder using Unity API
`AssetDatabase.CreateFolder()`, even with the workaround in #543, Unity
would still generate two error message and there is no way to turn it
off.

This change add an additional log after Unity API fails to inform the
user to ignore this error.
@googlesamples googlesamples locked and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants