public static SettingsProvider ScreenshotSettings()
    {
        var provider = new SettingsProvider("Preferences/Screenshot", SettingsScope.User)
        {
            label      = "Screenshot",
            guiHandler = (searchContent) =>
            {
                FileNameFormat = EditorGUILayout.TextField("File name format", FileNameFormat);
                EditorGUILayout.HelpBox("{P} = Project name\n{S} = Scene name\n{R} = Resolution\n{D} = Date\n{T} = Time\n{U} = Unique number", MessageType.None);

                EditorGUILayout.LabelField("Example: " + ScreenshotUtility.FormatFileName(1, DateFormats[DateFormat]));

                ScreenshotUtility.DateFormat = EditorGUILayout.Popup("Date format", DateFormat, DateFormats);
            },

            keywords = new HashSet <string>(new[] { "Screenshot" })
        };

        return(provider);
    }
Esempio n. 2
0
    public static SettingsProvider ScreenshotSettings()
    {
        var provider = new SettingsProvider("Preferences/Screenshot", SettingsScope.User)
        {
            label      = "Screenshot",
            guiHandler = (searchContent) =>
            {
                FileNameFormat = EditorGUILayout.TextField("File name format", FileNameFormat);
                EditorGUILayout.HelpBox("{P} = Project name\n{S} = Scene name\n{R} = Resolution\n{D} = Date\n{T} = Time\n{U} = Unique number", MessageType.None);
                ScreenshotUtility.DateFormat = EditorGUILayout.Popup("Date format", DateFormat, DateFormats, GUILayout.MaxWidth(250f));
                ScreenshotUtility.TimeFormat = EditorGUILayout.Popup("Time format", TimeFormat, TimeFormats, GUILayout.MaxWidth(250f));
                EditorGUILayout.LabelField("Example: " + ScreenshotUtility.FormatFileName(1, DateFormats[DateFormat]), EditorStyles.miniLabel);

                EditorGUILayout.Space();

                ListenToPrintButton = EditorGUILayout.Toggle(new GUIContent("Print-screen button", "If the window is open, capture a screenshot whenever the print-screen keyboard button is pressed"), ListenToPrintButton);
            },

            keywords = new HashSet <string>(new[] { "Screenshot" })
        };

        return(provider);
    }