private static void Init() { CreateNewScene window = (CreateNewScene)GetWindow(typeof(CreateNewScene)); window.minSize = new Vector2(300, 10); window.titleContent.text = "Create New Scene"; window.Show(); }
private void OnGUI() { GUI.backgroundColor = Color.grey; CreateNewScene window = (CreateNewScene)GetWindow(typeof(CreateNewScene)); DrawSceneConfigSection(); EditorGUILayout.Space(spacerSize); DrawLevelDataConfigSection(); EditorGUILayout.Space(spacerSize); if (GUILayout.Button("Create New Scene") && CanCreateScene()) { string i = addToBuildIndex ? "true" : "false"; int option = EditorUtility.DisplayDialogComplex("Are you sure you want to create this scene?", $"Are you sure you want to create a new scene with these settings?\n\nTemplate: {currentTemplate.ToString()}\nScene name: {sceneName}\nAdd to build settings: {i}", "Create", "Cancel", ""); switch (option) { // Create button case 0: CreateScene(); window.Close(); break; // Cancel button case 1: break; // No clue what this is. Probably the X button. case 2: break; default: LogUtils.LogError("Unrecognized option. Scene creation failed."); break; } } }