Beispiel #1
0
        private static void DevHelpersGUI()
        {
            Skin.StartSection("Helpers (Dev Only)", false);

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Reset Twitter Access"))
            {
                if (EditorUtility.DisplayDialog("Reset Twitter OAuth Tokens?",
                                                "Do you also want to clear the Twitter access tokens?",
                                                "Yes", "Do Not Clear Them"))
                {
                    TwitterSettings.ClearAccessTokens();
                }
            }

            if (GUILayout.Button("Reset Meta Data"))
            {
                EntryPanelSettings.ResetMetaData();
            }

            if (GUILayout.Button("Reset All EditorPrefs"))
            {
                if (EditorUtility.DisplayDialog("Reset Everything",
                                                "Are you sure you want to reset everything? " +
                                                "No data will be deleted, but all settings will be reset. " +
                                                "This should only be used if you know what you are doing.\n\n " +
                                                "Note, the DevLogger window will be closed, you should reopen it from the `Tools/Wizards Code` menu.",
                                                "Yes, Reset",
                                                "No, do not reset"))
                {
                    Settings.Reset();
                    EntryPanelSettings.Reset();
                    GitSettings.Reset();
                    TwitterSettings.Reset();
                    DiscordSettings.Reset();
                    window.Close();
                }
            }

            if (GUILayout.Button("Dump Window Names"))
            {
                EditorWindow[] allWindows = Resources.FindObjectsOfTypeAll <EditorWindow>();
                foreach (EditorWindow window in allWindows)
                {
                    Debug.Log("Window name: " + window);
                }
            }
            EditorGUILayout.EndHorizontal();
        }