예제 #1
0
    public void OnGUI()
    {
        Refresh();

        Scene activeScene = EditorSceneManager.GetActiveScene();

        foreach (string path in _scenePaths)
        {
            Scene scene = SceneManager.GetSceneByPath(path);

            bool isActiveScene = activeScene == scene;

            EditorGUI.BeginDisabledGroup(isActiveScene);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(CoreEditorUtils.GetSceneNameFromPath(path));

            if (GUILayout.Button("Import"))
            {
                ImportScene(path);
            }

            if (GUILayout.Button("Open"))
            {
                OpenScene(path);
            }

            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndHorizontal();
        }
    }