Skip to content

Commit

Permalink
Merge pull request apple#6 from makeplayhappy/find_framework_fix
Browse files Browse the repository at this point in the history
Fix AssetDatabase.FindAssets frameworks
  • Loading branch information
DodgyTim authored Jul 7, 2023
2 parents 86b5fed + cda31a2 commit 9a638fc
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ public static string GetPluginLibraryPathForBuildTarget(string libraryName, Buil
}
}

// try without the .framework, Unity.2022 AssetDatabase.FindAssets fails with ".frameworks"
if( libraryName.EndsWith(".framework") )
{
string libraryNameWithoutFramework = libraryName.Substring( 0, libraryName.LastIndexOf(".framework") );
results = AssetDatabase.FindAssets(libraryNameWithoutFramework);
foreach (string currGUID in results)
{
string libraryPath = AssetDatabase.GUIDToAssetPath(currGUID);
string[] folders = libraryPath.Split('/');
if (Array.IndexOf(folders, platformString) > -1)
{
return libraryPath;
}
}

}

return string.Empty;
}

Expand Down

0 comments on commit 9a638fc

Please sign in to comment.