Skip to content

alexisstrat/unity-toolbar-extender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Toolbar Extender

Works up to Unity 6.2!. From Unity 6.3 and onwards there is the Toolbar API with static methods and attributes.

A Unity package that allows you to extend the Unity Editor toolbar with custom buttons and controls using Visual Elements. exampleToolbar.png

Install via manifest

"com.alexandros.unity-toolbar-extender": "https://github.com/alexisstrat/unity-toolbar-extender.git?path=/Packages/com.alexandros.unity-toolbar-extender"

Usage:

  1. Create a new Configuration via create -> Toolbar Extender/Configuration.
  2. Create a scriptable object that inherits from ToolbarElement.cs and implement the CreateElement method.
  3. Add the scriptable object to the ToolbarElement field in the configuration. exampleConfiguration.png

Creating a button:

Inherit from ToolbarButton and implement the OnClick method.

[CreateAssetMenu(menuName = "Toolbar Extender/Example Button")]
public class ExampleToolbarButton : ToolbarButton
{
    protected override void OnClick()
    {
        Debug.Log("Example Toolbar Button Clicked!");
    }
}

Creating a slider:

Inherit from ToolbarSlider and implement the OnValueChanged method.

[CreateAssetMenu (menuName = "Toolbar Extender/Example Slider")]
public class ExampleSlider : ToolbarSlider
{
    protected override void OnValueChanged(float newValue)
    {
        Debug.Log($"Slider value changed: {newValue}");
    }
}

Ready-made controls:

  • Toolbar Extender/Scene Button: Adds a button to the toolbar that opens a specified scene. sceneButton.png

Known Issues:

When moving UnityEditor to a different resolution monitor, the toolbar may disappear. Find your configuration scriptable and click "Manual Refresh" or recompile.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages