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

Warning logged when deleting folder #21

Closed
rhys-vdw opened this issue Aug 10, 2023 · 2 comments · Fixed by #23
Closed

Warning logged when deleting folder #21

rhys-vdw opened this issue Aug 10, 2023 · 2 comments · Fixed by #23

Comments

@rhys-vdw
Copy link
Contributor

rhys-vdw commented Aug 10, 2023

Perhaps only on empty folder

ProjectCurator: Asset 'Assets/_Game/Config/Graphs/Statuses' is not present in the database
UnityEngine.Debug:LogWarning (object)
Ogxd.ProjectCurator.ProjectCurator:Warn (string) (at ./Library/PackageCache/com.ogxd.project-curator@6a70b7c196/Editor/ProjectCurator.cs:165)
Ogxd.ProjectCurator.ProjectCurator:RemoveAssetFromDatabase (string) (at ./Library/PackageCache/com.ogxd.project-curator@6a70b7c196/Editor/ProjectCurator.cs:96)
Ogxd.ProjectCurator.AssetProcessor:OnWillDeleteAsset (string,UnityEditor.RemoveAssetOptions) (at ./Library/PackageCache/com.ogxd.project-curator@6a70b7c196/Editor/AssetProcessor.cs:64)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
@rhys-vdw
Copy link
Contributor Author

rhys-vdw commented Oct 15, 2023

Looking into this now. The issue here is that the GUID is coming back empty when adding a new empty folder, even in the deferred action.

        static void OnWillCreateAsset(string assetPath)
        {
            UnityEngine.Debug.Log("Asset path: " + assetPath);
            if (ProjectCuratorData.IsUpToDate) {
                Actions.Enqueue(() => {
                    UnityEngine.Debug.Log($"Guid string is: " + AssetDatabase.AssetPathToGUID(assetPath));
                    var guid = AssetDatabase.GUIDFromAssetPath(assetPath);
                    if (!guid.Empty()) {
                        ProjectCurator.AddAssetToDatabase(guid);
                    } else {
                        UnityEngine.Debug.LogWarning($"GUID for asset at path {assetPath} is empty");
                    }
                });
            }
        }
Asset path: Assets/_Game/New Folder.meta
UnityEngine.Debug:Log (object)
Ogxd.ProjectCurator.AssetProcessor:OnWillCreateAsset (string) (at C:/Users/rhysv/Projects/project-curator/Editor/AssetProcessor.cs:49)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Guid string is: 
UnityEngine.Debug:Log (object)
Ogxd.ProjectCurator.AssetProcessor/<>c__DisplayClass4_0:<OnWillCreateAsset>b__0 () (at C:/Users/rhysv/Projects/project-curator/Editor/AssetProcessor.cs:52)
Ogxd.ProjectCurator.AssetProcessor:OnUpdate () (at C:/Users/rhysv/Projects/project-curator/Editor/AssetProcessor.cs:25)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

GUID for asset at path Assets/_Game/New Folder.meta is empty
UnityEngine.Debug:LogWarning (object)
Ogxd.ProjectCurator.AssetProcessor/<>c__DisplayClass4_0:<OnWillCreateAsset>b__0 () (at C:/Users/rhysv/Projects/project-curator/Editor/AssetProcessor.cs:57)
Ogxd.ProjectCurator.AssetProcessor:OnUpdate () (at C:/Users/rhysv/Projects/project-curator/Editor/AssetProcessor.cs:25)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

@rhys-vdw
Copy link
Contributor Author

Worked it out. It's a bug in Unity that causes the wrong path to be passed.

@ogxd ogxd closed this as completed in #23 Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant