-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial System
- First ensure that there is a
Dashboard Controller
in the scene. If not, find theDashboard Controller
prefab underAssets -> Prefabs -> Dashboard -> Dashboard Controller
and drag it into the scene under theLeftControllerAnchor
. - Drag a
Tutorial Controller
prefab into the scene. This prefab is found underAssets->Prefabs->Dashboard->Tutorial Controller
.
The TutorialStep.cs
script is the base class for all the steps of a tutorial.
Create a separate script for each step of your tutorial (switch vision, grab, teleport, etc.) All your tutorial scripts should derive from TutorialStep
and not from Monobehavior
.
public class LobbyPress : TutorialStep
By deriving from TutorialStep
, your script will have a few parameters already in the inspector:
- Dashboard Text: Fill in this text box with the text you want the dashboard to display during this tutorial step.
- Allow Active False: If this is checked, the gameobject that your tutorial step script is attached to will be turned off when the player is not on this step.
In your tutorial script, you must implement:
Setup
public override void Setup(TextMeshPro TMP)
This is where this particular step's relevant gameobjects are turned on, listeners attached, etc. This function is called when this particular step is activated. Make sure to include TMP.text = dashboardText;
to update the dashboard text to the text inputted under Dashboard Text in the inspector.
Cleanup
public override void Cleanup(TextMeshPro TMP)
This is where the relevant gameobjects are turned off, listeners detached, etc. This function is called when this particular step is deactivated.
OnDone.Invoke();
needs to be called when the player has completed this step in the tutorial so that the TutorialController
script knows to move on to the next step.
The tutorial controller prafab is an empty gameobject that contains TutorialController.cs
. This script works in conjunction with TutorialDashboard.cs
which is attached to the Tutorial Dashboard
object parented under the Dashboard Controller
.
The TutorialController.cs
script takes in multiple parameters:
-
TMP: TMP refers to the TextMeshPro component that will display the text on the dashboard for each tutorial step. Drag in the
Dashboard TMP
parented under theTutorial Dashboard
into this slot. - Tutorial Steps: This is an array of all your individual tutorial steps.
-
Skip Button: A reference to the
Skip Button
object parented underDashboard Controller -> Tutorial Dashboard -> Skip Button
. -
Camera Rig: A reference to the OVRCameraRig. Used in conjunction with the
spawn point
. - Spawn Point: An empty gameobject whose transform is where you want the player to move to.
-
Move To Spawn: A boolean that, if true, moves the
Camera Rig
(player) to theSpawn Point
if they press the skip button (example: move the player to the main animal island in the lobby if skip is pressed.)