Find a file
2025-12-06 15:25:17 +01:00
Editor Navigation tools upgraded to use the new MainToolbarElement API 2025-12-06 15:17:30 +01:00
Samples~ Samples: Updated to 2.0.0 2025-12-06 15:25:17 +01:00
.gitignore Initial commit 2021-02-12 20:30:06 +00:00
CHANGELOG.md Navigation tools upgraded to use the new MainToolbarElement API 2025-12-06 15:17:30 +01:00
CHANGELOG.md.meta 1.8.0: Added target frame rate and PlayerPrefs.Delete to toolbar 2022-12-07 22:10:09 +01:00
Editor.meta 0.1.0: Added favorites window 2021-02-14 11:14:16 +01:00
LICENSE Upload files to "/" 2025-06-07 20:53:17 +00:00
LICENSE.meta Added missing meta files 2025-06-18 18:04:14 +02:00
package.json Navigation tools upgraded to use the new MainToolbarElement API 2025-12-06 15:17:30 +01:00
package.json.meta 0.1.0: Added favorites window 2021-02-14 11:14:16 +01:00
README.md Updated README 2025-12-06 15:23:37 +01:00
README.md.meta 1.1.0: Added README and ToolbarSettings, so visibility of tools can be set in Preferences -> Module -> Toolbar 2021-12-19 20:49:15 +01:00

Description

This module contains a few helpful editor tools, like favorites, history and some handy toolbar tools.

Favorites

An editor window, where you can pin folders and assets, so you can easily find the most used assets in your project.

History

An editor window, where the history of all selected assets are shown. An asset in the window can be selected to easy get back to previous selections.

Toolbar

Toolbars to the left and right of the play-buttons by using the MainToolbarElement-attribute.

Default tools

Several tools are available from start:

  • Build: Select build target and build
  • Player Prefs: Delete all PlayerPrefs data
  • Scene: Load any scene in the project easily by using the dropdown
  • Time Scale: Adjust the time scale from [0;1] from a slider
  • UI Canvas: Select and center the camera on any Canvases in the scene
  • UI Layer: Toggle the UI layer on/off
  • Settings: Open project or preferences
  • Save: Project save

Customization

You can create your own toolbar extensions by using the property attribute MainToolbarElement.

[Preserve]
[MainToolbarElement("Toolbar/Time Scale", ussName = "", defaultDockIndex = 0, defaultDockPosition = MainToolbarDockPosition.Middle, menuPriority = 500)]
public static MainToolbarElement Draw()
{
    var content = new MainToolbarContent("Time:", "Adjust Time.timeScale from [min;max] and snaps when value is approximately 1.0");
    return new MainToolbarSlider(content, Time.timeScale, ToolbarTimeSettings.TimeScaleMinValue, ToolbarTimeSettings.TimeScaleMaxValue, OnTimeScaleValueChanged);
}

private static void OnTimeScaleValueChanged(float value)
{
    value = Mathf.Clamp(value, ToolbarTimeSettings.TimeScaleMinValue, ToolbarTimeSettings.TimeScaleMaxValue);

    if (Mathf.Abs(value - 1.0f) < 0.02f)
        value = 1.0f;

    if (!Mathf.Approximately(Time.timeScale, value))
        Time.timeScale = value;
}

A list of multiple controls can be done by changing:

public static MainToolbarElement Draw()

to

public static IEnumerable<MainToolbarElement> Draw()

Customization - Settings

To add enable/disable settings or more to Preferences -> Toolbar, you can implement IToolbarSettings.

internal sealed class ToolbarFooSettings : IToolbarSettings
{
    public string Title => "Foo";
    
    private const string PREF_MIN_VALUE = "ToolbarSettings_MinValue";
    private const string PREF_MAX_VALUE = "ToolbarSettings_MaxValue";
    
    public static float MinValue
    {
        get => EditorPrefs.GetFloat(PREF_IS_UI_ENABLED, false);
        set => EditorPrefs.SetFloat(PREF_IS_UI_ENABLED, value);
    }

    public static float MaxValue
    {
        get => EditorPrefs.GetFloat(PREF_IS_UI_LAYER_ENABLED, false);
        set => EditorPrefs.SetFloat(PREF_IS_UI_LAYER_ENABLED, value);
    }

    public void Draw()
    {
        MinValue = EditorGUILayout.FloatField("Min Value", TimeScaleMinValue);
        MaxValue = EditorGUILayout.FloatField("Max Value", TimeScaleMaxValue);
    }
}

If you need to refresh a control, due to changes in settings. Then invoke:

MainToolbar.Refresh("Toolbar/Time Scale");