/// <summary>获取所有场景名字</summary>标签:count,场景,string,strs,获取,Unity,sceneNamesArr,str From: https://blog.51cto.com/u_14359474/6086409
private string[] getAllSceneName()
{
int count = SceneManager.sceneCountInBuildSettings;
string[] sceneNamesArr = new string[count];
for (int i = 0; i < count; i++)
{
sceneNamesArr[i] = SceneUtility.GetScenePathByBuildIndex(i);
string[] strs = sceneNamesArr[i].Split('/');
string str = strs[strs.Length - 1];
strs = str.Split('.');
str = strs[0];
sceneNamesArr[i] = str;
Debug.Log("场景名字:" + str);
}
return sceneNamesArr;
}