mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[unity] Fixed IndexOutOfRangeException on Unity 2022.2 upon first project import or upgrade. Closes #2241.
This commit is contained in:
parent
be983ac413
commit
bf5d445fa7
@ -173,17 +173,22 @@ namespace Spine.Unity.Editor {
|
||||
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||
|
||||
string[] folders = { "Assets", "Packages" };
|
||||
string[] assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities", folders);
|
||||
string assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
||||
editorPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
|
||||
|
||||
string[] assets;
|
||||
string assetPath;
|
||||
assets = AssetDatabase.FindAssets("t:texture icon-subMeshRenderer", folders);
|
||||
if (assets.Length > 0) {
|
||||
assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
||||
editorGUIPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
|
||||
} else {
|
||||
editorGUIPath = editorPath.Replace("/Utility", "/GUI");
|
||||
}
|
||||
assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities", folders);
|
||||
if (assets.Length > 0) {
|
||||
assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
||||
editorPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
|
||||
if (string.IsNullOrEmpty(editorGUIPath))
|
||||
editorGUIPath = editorPath.Replace("/Utility", "/GUI");
|
||||
}
|
||||
if (string.IsNullOrEmpty(editorGUIPath))
|
||||
return;
|
||||
Icons.Initialize();
|
||||
|
||||
// Drag and Drop
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user