1.1.0: Added README and ToolbarSettings, so visibility of tools can be set in Preferences -> Module -> Toolbar
This commit is contained in:
parent
e1d2deb4c5
commit
9802f8aaa3
23 changed files with 297 additions and 43 deletions
60
README.md
Normal file
60
README.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# 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. Anything can be added, as long as it is supported by IMGUI.
|
||||
|
||||
|
||||
### Default tools
|
||||
|
||||
Three tools are available from start:
|
||||
|
||||
* UI Layer: Toggle the UI layer on/off
|
||||
* UI Canvas: Select and center the camera on any Canvases in the scene
|
||||
* Scene: Load any scene in the project easily by using the dropdown
|
||||
|
||||
|
||||
### Customization
|
||||
|
||||
You can create your own toolbar extensions by extending `AbstractToolbarDrawer`.
|
||||
|
||||
```
|
||||
internal sealed class MyCustomTool : AbstractToolbarDrawer
|
||||
{
|
||||
public override bool Visible => true;
|
||||
public override bool Enabled => true;
|
||||
public override EToolbarPlacement Placement => EToolbarPlacement.Left;
|
||||
public override int Priority => (int)EToolbarPriority.Medium;
|
||||
|
||||
protected override void Draw(Rect rect)
|
||||
{
|
||||
// Use IMGUI methods for drawing
|
||||
}
|
||||
|
||||
public override float CalculateWidth()
|
||||
{
|
||||
// Default height for toolbar buttons is 30
|
||||
return 30.0f;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The four properties help define draw and enable state:
|
||||
|
||||
* `Visible`: If it is visible in the toolbar
|
||||
* `Enabled`: If it is enabled in the toolbar (`GUI.enabled`)
|
||||
* `Placement`: If it is placed to the left or right of the play-buttons
|
||||
* `Priority`: Sort order/priority, when drawing the tool
|
||||
Loading…
Add table
Add a link
Reference in a new issue