Skip to content

hanryliao/unity-toolbar-extender

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unity-toolbar-extender

Extend the Unity Toolbar with your own UI code. Please note that it's super hacky as the code is heavily relying on using reflection to access Unity's internal code. It might not work anymore with a new Unity update.

Add buttons to quickly access scenes, add sliders, toggles, anything.

Imgur

How to

This example code is shown in action in the gif below. Just copy the class, change it and make as many as you like. You can remove the Example folder from the project. All you need is ExtendedToolbarWindow.cs.

	[InitializeOnLoad]
	public class LeftButtonToolbarWindow : ExtendedToolbarWindow
	{
		static LeftButtonToolbarWindow()
		{
			RegisterToolbarWindow<LeftButtonToolbarWindow>(width:35, horizontalOffset:-90);
		}

		protected override void OnGUI()
		{
			base.OnGUI();

			var buttonRect = new Rect(0, 0, position.width, position.height);
			buttonRect.y = 4;

			if(GUI.Button(buttonRect, "1", Styles.commandButtonStyle))
			{
				SceneHelper.StartScene("Assets/ToolbarExtender/Example/Scenes/Scene1.unity");
			}
		}
	}

Imgur

About

Extend the Unity Toolbar with your own Editor UI code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%