Merge pull request #64 from ZemelLing/dev-launcher

This commit is contained in:
ALEXTANG
2024-04-12 18:17:06 +08:00
committed by GitHub

View File

@@ -72,7 +72,23 @@ namespace TEngine
}
else
{
string scenePath = AssetDatabase.GUIDToAssetPath(guids[0]);
string scenePath = null;
// 优先打开完全匹配_sceneToOpen的场景
for (var i = 0; i < guids.Length; i++)
{
scenePath = AssetDatabase.GUIDToAssetPath(guids[i]);
if (scenePath.EndsWith("/" + _sceneToOpen + ".unity"))
{
break;
}
}
// 如果没有完全匹配的场景,默认显示找到的第一个场景
if (string.IsNullOrEmpty(scenePath))
{
scenePath = AssetDatabase.GUIDToAssetPath(guids[0]);
}
EditorSceneManager.OpenScene(scenePath);
EditorApplication.isPlaying = true;
}