Skip to content

Instantly share code, notes, and snippets.

@JoseMiguelPizarro
Last active August 31, 2019 13:01
Show Gist options
  • Save JoseMiguelPizarro/b847b9c47982fdc7a86508d6fbf0670b to your computer and use it in GitHub Desktop.
Save JoseMiguelPizarro/b847b9c47982fdc7a86508d6fbf0670b to your computer and use it in GitHub Desktop.
Rendering tool bar
private int toolBarWidth = 50;
private int selectedTool;
private void OnSceneGUI()
{
DrawToolBar(SceneView.lastActiveSceneView);
}
public void DrawToolBar(SceneView view)
{
Rect rect = new Rect(0, 0, toolBarWidth, view.position.height);
GUILayout.BeginArea(rect, EditorStyles.textArea);
selectedTool = GUILayout.SelectionGrid(selectedTool, toolsButton, 1, EditorStyles.toolbarButton, GUILayout.Width(50), GUILayout.Height(50));
GUILayout.EndArea();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment