Пример #1
0
        private void OnGUI()
        {
            selectedValue      = EditorGUILayout.Popup("Selected Level", selectedValue, levelOptions);
            selectedSceneValue = EditorGUILayout.Popup("Scene To Delete", selectedSceneValue, sceneOptions);


            selectedGameLevel = levels[selectedValue];

            if (previousSelectedValue != selectedValue)
            {
                WindowRefresh.RefreshScenesList(selectedGameLevel, out sceneOptions, out selectedSceneValue);
                previousSelectedValue = selectedValue;
            }

            sceneToRename = sceneOptions[selectedSceneValue];

            newName = EditorGUILayout.TextField("New Scene Name", newName);

            if (!string.IsNullOrEmpty(newName))
            {
                if (GUILayout.Button("Rename Selected Scene"))
                {
                    RenameSelectedScene();
                    WindowRefresh.RefreshScenesList(selectedGameLevel, out sceneOptions, out selectedSceneValue);
                }
            }
        }
Пример #2
0
 public static void OpenMenu()
 {
     window = (DeleteSceneFromGameLevel)GetWindow(typeof(DeleteSceneFromGameLevel), false, "Delete Scene From Level");
     WindowRefresh.RefreshLevelsList(out window.levelOptions, out window.selectedValue, out window.levels, out window.gameLevelData);
     window.selectedGameLevel = window.levels[window.selectedValue];
     WindowRefresh.RefreshScenesList(window.selectedGameLevel, out window.sceneOptions, out window.selectedSceneValue);
 }
Пример #3
0
        private void OnGUI()
        {
            selectedValue      = EditorGUILayout.Popup("Selected Level", selectedValue, levelOptions);
            selectedSceneValue = EditorGUILayout.Popup("Scene To Delete", selectedSceneValue, sceneOptions);


            selectedGameLevel = levels[selectedValue];

            if (previousSelectedValue != selectedValue)
            {
                WindowRefresh.RefreshScenesList(selectedGameLevel, out sceneOptions, out selectedSceneValue);
                previousSelectedValue = selectedValue;
            }

            selectedSceneToDestroy = sceneOptions[selectedSceneValue];

            if (GUILayout.Button("Delete Scene From Selected Level"))
            {
                RemoveScene();
                WindowRefresh.RefreshScenesList(selectedGameLevel, out sceneOptions, out selectedSceneValue);
            }
        }
        private void OnGUI()
        {
            selectedValue         = EditorGUILayout.Popup("Selected Level", selectedValue, levelOptions);
            selectedSceneValue    = EditorGUILayout.Popup("Scene To Decouple", selectedSceneValue, sceneOptions);
            selectedGameLevel     = levels[selectedValue];
            targetSceneToDecouple = sceneOptions[selectedSceneValue];

            EditorGUILayout.HelpBox("Use The Directory After 'Assets/', e.g. 'Scenes/MyScene01'", MessageType.Info);
            targetFolderToDumpSceneIn = EditorGUILayout.TextField("Target Folder To Dump Scene In", targetFolderToDumpSceneIn);

            if (Directory.Exists("Assets/" + targetFolderToDumpSceneIn))
            {
                if (GUILayout.Button("Decouple Scene From Game Level"))
                {
                    DecoupleScene();
                    WindowRefresh.RefreshScenesList(selectedGameLevel, out sceneOptions, out selectedSceneValue);
                }
            }
            else
            {
                EditorGUILayout.HelpBox("Target Folder Does Not Exist, Please Create Manually", MessageType.Error);
            }
        }