在editor模式下遍歷unity3d builtsetting中的場景

foreach (UnityEditor.EditorBuildSettingsScene S in UnityEditor.EditorBuildSettings.scenes)ide

{ui

//在built setting中是否已經開啓spa

    if(S.enabled)
string

{it

    

//獲得場景的名稱io

                string name = S.path;class

                //打開這個場景foreach

EditorApplication.OpenScene(name);遍歷

//遍歷場景中的GameObjectdi

foreach (GameObject obj in Object.FindObjectsOfType(typeof(GameObject)))

{

}

}

}

相關文章
相關標籤/搜索