Skip to content

Commit 9a638fc

Browse files
authored
Merge pull request apple#6 from makeplayhappy/find_framework_fix
Fix AssetDatabase.FindAssets frameworks
2 parents 86b5fed + cda31a2 commit 9a638fc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleFrameworkUtility.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ public static string GetPluginLibraryPathForBuildTarget(string libraryName, Buil
4343
}
4444
}
4545

46+
// try without the .framework, Unity.2022 AssetDatabase.FindAssets fails with ".frameworks"
47+
if( libraryName.EndsWith(".framework") )
48+
{
49+
string libraryNameWithoutFramework = libraryName.Substring( 0, libraryName.LastIndexOf(".framework") );
50+
results = AssetDatabase.FindAssets(libraryNameWithoutFramework);
51+
foreach (string currGUID in results)
52+
{
53+
string libraryPath = AssetDatabase.GUIDToAssetPath(currGUID);
54+
string[] folders = libraryPath.Split('/');
55+
if (Array.IndexOf(folders, platformString) > -1)
56+
{
57+
return libraryPath;
58+
}
59+
}
60+
61+
}
62+
4663
return string.Empty;
4764
}
4865

0 commit comments

Comments
 (0)