-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial System
The Tutorial Manager script controls the following three parts:
- Instructions
- Status
- Tutorial panel
The instruction is the text floating on the top of the screen. It will stay there until the user completes the action. Use ShowInstruction() and ClearInstruction() to display and clear the instruction text.
The status is the text floating at the bottom of the screen. As its name suggests, it is supposed to trigger when a state changes -- when the user clicks on a button, switches to a new visualization, etc. It will shop up for a short time, and then will be cleared. Use ShowStatus() to display the status text.
The tutorial panel is a screen overlay canvas that will cover half of the screen when something important needs to be addressed -- showing the user how to navigate around, explaining what each visualization means, etc. It supports paging and callback functions at each page. It also allows users to skip one specific tutorial or to skip everything. A confirmation panel will pop out if the user chooses to skip everything, to prevent clicks by accident. The user is also able to choose to display tutorials in the pause menu.
Each page consists of a title, a content text, and a callback function. All of these are stored in Tutorial Param.
To display a tutorial, use ShowTutorial(). This method is overloaded so that if you only have one page you don't need to manually create an array.
The tutorial panel uses several booleans to keep track of its states. confirmed boolean corresponds to "Next" -- going to the next page, if any. skipCurrent corresponds to "Skip" -- skip this specific tutorial. skipAll corresponds to "Skip all" -- skipping all tutorials.
To prevent triggering multiple tutorials at the same time, a Queue is used to store the tutorials. Whenever a call to ShowTutorial() is made, the manager checks if the a tutorial is being played. If so, it will store the parameters to the Queue. When a tutorial is over and the user does not choose to "Skip All", the manager will check if the Queue is empty. If it is not, it will dequeue a Tutorial Param and start a new tutorial. If the user chooses to "Skip All", the queue will be cleared.