private void DisplayFileSpecificMenu() { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Delete File", EditorStyles.toolbarButton)) { if (EditorUtility.DisplayDialog("Delete this File?", "Are you sure you want to permanently delete this file?", "Delete File", "Cancel")) { ES2.Delete(currentFilePath); Reset(); } } string showFileText = "Show in Explorer"; if (OSFileBrowser.IsInMacOS) { showFileText = "Show in Finder"; } if (GUILayout.Button(showFileText, EditorStyles.toolbarButton)) { ES2EditorTools.ShowInFileBrowser(currentFilePath); } if (GUILayout.Button("Refresh File", EditorStyles.toolbarButton)) { OpenFile(); } EditorGUILayout.EndHorizontal(); }
public void Draw() { ES2EditorWindowStyle style = ES2EditorWindow.instance.style; EditorGUILayout.BeginVertical(style.windowContentStyle); EditorGUILayout.BeginHorizontal(style.sectionStyle); if (ES2EditorUtility.Button("Clear Default Save Folder")) { ES2EditorTools.ClearDefaultSaveFolder(); } if (ES2EditorUtility.Button("Clear PlayerPrefs")) { ES2EditorTools.ClearPlayerPrefs(); } if (ES2EditorUtility.Button("Open Default Save Folder")) { ES2EditorTools.ShowInFileBrowser(Application.persistentDataPath); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(style.sectionStyle); if (ES2EditorUtility.Button("Add Default Settings Object to Scene")) { GameObject g = new GameObject(); g.name = "Easy Save Default Settings"; g.AddComponent <ES2GlobalSettings>(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(style.sectionStyle); if (ES2EditorUtility.Button("Enable or Update Playmaker Action")) { AssetDatabase.ImportPackage(Application.dataPath + "/Easy Save 2/Disabled/ES2Playmaker.unitypackage", false); AssetDatabase.Refresh(); EditorUtility.DisplayDialog("Easy Save 2 PlayMaker Action Enabled", "Easy Save 2 PlayMaker Action has been Enabled and Updated.", "Ok"); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); }
public void DisplayTools() { EditorGUILayout.Space(); EditorGUILayout.LabelField("Tools", EditorStyles.boldLabel); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Clear Default Save Folder")) { ES2EditorTools.ClearDefaultSaveFolder(); } if (GUILayout.Button("Clear PlayerPrefs")) { ES2EditorTools.ClearPlayerPrefs(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Open Default Save Folder")) { ES2EditorTools.ShowInFileBrowser(Application.persistentDataPath); } EditorGUILayout.EndHorizontal(); }