public override void Go() { base.Go(); GUILayout.BeginHorizontal(EditorStyles.toolbar); foreach (var editorCommand in LeftCommands.OrderBy(p => p.Order)) { DoCommand(editorCommand); } GUILayout.FlexibleSpace(); foreach (var editorCommand in RightCommands.OrderBy(p => p.Order)) { DoCommand(editorCommand); } GUILayout.EndHorizontal(); }
public void AddCommand(ToolbarItem command) { var cmd = command; if (cmd == null || cmd.Position == ToolbarPosition.Right) { RightCommands.Add(command); } else if (cmd.Position == ToolbarPosition.BottomLeft) { BottomLeftCommands.Add(command); } else if (cmd.Position == ToolbarPosition.BottomRight) { BottomRightCommands.Add(command); } else { LeftCommands.Add(command); } }