mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[unity] Fixed UPM package Index out of bounds exception in editor code. Closes #2095.
This commit is contained in:
parent
0c286734a7
commit
e39f74837a
@ -172,11 +172,12 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
|
||||||
string[] assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities");
|
string[] folders = { "Assets", "Packages" };
|
||||||
|
string[] assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities", folders);
|
||||||
string assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
string assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
||||||
editorPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
|
editorPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
|
||||||
|
|
||||||
assets = AssetDatabase.FindAssets("t:texture icon-subMeshRenderer");
|
assets = AssetDatabase.FindAssets("t:texture icon-subMeshRenderer", folders);
|
||||||
if (assets.Length > 0) {
|
if (assets.Length > 0) {
|
||||||
assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
||||||
editorGUIPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
|
editorGUIPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user