private void DrawMissingDataCreation() { if (ErrorDrawer.IsDataMissing(Manager)) { EditorGUILayout.BeginVertical(); if (!ErrorDrawer.IsAllDataMissing(Manager)) { EditorGUILayout.HelpBox("Some or all project data is missing. This may be because of new project data is required in this version of InAudio", MessageType.Warning, true); if (GUILayout.Button("Create missing content", GUILayout.Height(30))) { MissingDataHelper.CreateIfMissing(Manager); Manager.ForceLoad(); #if !UNITY_5_2 EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene()); EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo(); #else EditorApplication.MarkSceneDirty(); EditorApplication.SaveCurrentSceneIfUserWantsTo(); #endif } } DrawStartFromScratch(); EditorGUILayout.EndVertical(); } }
public static bool AllDataMissing(InCommonDataManager manager) { EditorGUILayout.HelpBox("No InAudio project found. Create InAudio project?", MessageType.Info); if (GUILayout.Button("Create InAudio data")) { MissingDataHelper.StartFromScratch(manager); } return(true); }
private void DrawStartFromScratch() { Repeater.Repeat(8, () => { EditorGUILayout.Separator(); }); EditorGUILayout.HelpBox("Warning, this button will delete the entire InAudio project and create a new. This process cannot be undone.", MessageType.Error); if (GUILayout.Button("Start over from scratch", GUILayout.Height(30))) { if (ErrorDrawer.IsAllDataMissing(Manager) || EditorUtility.DisplayDialog("Create new project?", "This will delete ALL data!", "Start over from scratch", "Do nothing")) { MissingDataHelper.StartFromScratch(Manager); } } }
private void DrawStartFromScratch() { EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space(); if (GUILayout.Button("Start over from scratch", GUILayout.Height(30))) { if (AreAllMissing() || EditorUtility.DisplayDialog("Create new project?", "This will delete ALL data!", "Start over from scratch", "Do nothing")) { MissingDataHelper.StartFromScratch(Manager); } } }