Workspaces

The main feature of Hats is to create workspaces. A workspace can be seen as similar to an Editor layout, but is much more powerful, thanks to a variety of rules that can trigger when the workspace is enabled.

Build on Hats

In addition to using workspaces to trigger rules, you can also build tools that modify their appearance or behaviour depending on the active workspace.

Default workspace

When you first start Hats, a Default workspace is created and activated. This workspace has no rules, meaning that the Editor is not modified in any way.

When you remove an active workspace or something "bad" happens (i.e. the active workspace asset is deleted), Hats reverts to the Default workspace.

Create a workspace

Workspaces are personal, so each user on the project can have their own set. workspaces are represented by a ScriptableObject of type Workspace.

To create one, simply right-click in the Project window and choose Create > Hats > Workspace.

Once created, you can modify its properties:

The Inspector of a Workspace ScriptableObject

Notice that identifier, icon and colour are all important because they appear in the Workspace Switcher UI, and help you identify which workspace is active at the moment.

The identifier property is the one used in the UI. You can name the asset itself a more compact name, or add who the Workspace belongs to, if you're sharing them with the team.

i.e. "Level Design" as the identifier, vs. Jonathan_LevelDesign as the filename

The rules list contains workspace rules that trigger when the workspace becomes active. Click on the plus button to explore available types (and read all about them in the Rules section).

Once the file is setup, it's time to enable it.

Enable workspaces

To assign a workspace to your list, go to Project Settings > Hats, and add it to the list of Personal Workspaces.

The list of available workspaces, in Project Settings

As you add workspaces, you will notice that they become available in the Switcher UI at the top (next to Active Workspace).

Once at least 1 workspace is added to the list, you can now switch between them.

To understand if or how a workspace is used, select it and look at the bottom of its Inspector. You will find a series of messaging detailing whether the Workspace is in use, or if it's associated to a Team:

This workspace is available for switching, and currently active.

Remove a workspace

To remove a workspace from the available ones, you do so in Project Settings > Hats. You just need to remove it from the list.

Removing a workspace from the list doesn't delete the asset. So you can safely remove workspaces to disable them, keep the asset, and re-enable them at a later point.

Last updated