mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Merge pull request #64 from ZemelLing/dev-launcher
This commit is contained in:
@@ -72,7 +72,23 @@ namespace TEngine
|
|||||||
}
|
}
|
||||||
else
|
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);
|
EditorSceneManager.OpenScene(scenePath);
|
||||||
EditorApplication.isPlaying = true;
|
EditorApplication.isPlaying = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user