Class TutorialWindow
The window used to display tutorials and their content
Inherited Members
Namespace: Unity.Tutorials.Core.Editor
Syntax
public sealed class TutorialWindow : EditorWindowProxy
Fields
ShowTutorialsClosedDialog
Should we show the Close Tutorials info dialog for the user for the current project. By default the dialog is shown once per project and disabled after that.
Declaration
[Obsolete("Has no effect in v3, and will be removed in v4.")]
public static ProjectSetting<bool> ShowTutorialsClosedDialog
Field Value
Type | Description |
---|---|
ProjectSetting<Boolean> |
Remarks
You want to set this typically to false when running unit tests.
Properties
ActiveContainer
Active container of which tutorials we are viewing.
Declaration
[Obsolete("Will be removed in v4. Use CurrentCategory instead")]
public TutorialContainer ActiveContainer { get; set; }
Property Value
Type | Description |
---|---|
TutorialContainer |
CurrentCategory
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 CurrentCategory { 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 |
---|---|
Boolean |
Remarks
This transition typically happens when using a Switch Tutorial button on a tutorial page.
Methods
ClearContainers()
Clears any containers this window might be showing as available tutorial projects.
Declaration
[Obsolete("Will be removed in v4. Categories loading/unloading is now managed automatically by the TutorialWindow")]
public void ClearContainers()
Remarks
If we were viewing the container selection, the window is cleared.
ClearLocalizationCache()
Clear localization table cache
Declaration
public static void ClearLocalizationCache()
ExitTutorial()
Exits the current tutorial
Declaration
public static void ExitTutorial()
OnResized_Internal()
Re-find our instance if we've lost it This occurs when a window is maximized
Declaration
protected override void OnResized_Internal()
Overrides
SetContainers(IEnumerable<TutorialContainer>)
Sets the containers as available for selection as tutorial projects.
Declaration
[Obsolete("Will be removed in v4. Categories loading/unloading is now managed automatically by the TutorialWindow")]
public void SetContainers(IEnumerable<TutorialContainer> containers)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TutorialContainer> | containers | Container selection. |
Remarks
ActiveContainer must be set to null in order to view the selection.
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(Boolean)
Main logic for ShowWindow()
Declaration
public static TutorialWindow ShowWindow(bool shouldRefreshLayout)
Parameters
Type | Name | Description |
---|---|---|
Boolean | 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 the created, or already existing, window instance. |
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 |