Class TutorialWindow
The window used to display tutorials and their content
Inherited Members
Namespace: Unity.Tutorials.Editor
Assembly: Unity.Tutorials.Editor.dll
Syntax
public sealed class TutorialWindow : EditorWindow
Properties
CurrentContainer
The category of which tutorial are being displayed. Null if the project and its packages contains no categories, meaning all tutorials are being displayed.
Declaration
public TutorialContainer CurrentContainer { get; }
Property Value
| Type | Description |
|---|---|
| TutorialContainer |
CurrentTutorial
The currently active tutorial, if any.
Declaration
public Tutorial CurrentTutorial { get; }
Property Value
| Type | Description |
|---|---|
| Tutorial |
Instance
The active instance of this window
Declaration
public static TutorialWindow Instance { get; set; }
Property Value
| Type | Description |
|---|---|
| TutorialWindow |
IsTransitioningBetweenTutorials
Are we currently (during this frame) transitioning from one tutorial to another?
Declaration
public bool IsTransitioningBetweenTutorials { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This transition typically happens when using a Switch Tutorial button on a tutorial page.
Methods
ClearLocalizationCache()
Clear localization table cache
Declaration
public static void ClearLocalizationCache()
ExitTutorial()
Exits the current tutorial
Declaration
public static void ExitTutorial()
ShowWindow()
Shows Tutorials window using the currently specified behaviour.
Declaration
public static TutorialWindow ShowWindow()
Returns
| Type | Description |
|---|---|
| TutorialWindow | The the created, or already existing, window instance. |
Remarks
Different behaviors:
- If a single root tutorial container (TutorialContainer.ParentContainer is null) that has Project Layout specified exists, the window is loaded and shown using the specified project window layout (old behaviour). If the project layout does not contain Tutorials window, the window is shown an as a free-floating window.
- If no root tutorial containers exist, or a root container's Project Layout is not specified, the window is shown by anchoring and docking it next to the Inspector (new behaviour). If the Inspector is not available, the window is shown an as a free-floating window.
- If there is more than one root tutorial container with different Project Layout setting in the project, one asset is chosen randomly to specify the behavior.
- If Tutorials window is already created, it is simply brought to the foreground and focused.
ShowWindow(bool)
Main logic for ShowWindow()
Declaration
public static TutorialWindow ShowWindow(bool shouldRefreshLayout)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | shouldRefreshLayout | Whether or not we should reset the layout to the basic tutorial layout. Should be false when loading a tutorial step and true when first initializing the tutorial window. |
Returns
| Type | Description |
|---|---|
| TutorialWindow | The TutorialWindow, created or found open. |
StartTutorial(Tutorial)
Starts a tutorial as if it was clicked in the Table of content.
Declaration
public static void StartTutorial(Tutorial tutorial)
Parameters
| Type | Name | Description |
|---|---|---|
| Tutorial | tutorial | The tutorial to start |