Triggers
A trigger is one of the ways you can let your player proceed to the next stage of the tutorial. For example, you can make a setting to let the player go to the next tutorial by clicking the “Enter” key or clicking a UI button.
Trigger type
Specifies which trigger type this Stage will have.
Type | Description |
---|---|
Any Key Press | Action is triggered by clicking any button on the keyboard. |
Key Press | Action is triggered by clicking a specific button on the keyboard. |
Input | Action is triggered by clicking an input. |
UGUI Button Click | Action is triggered by clicking a UGUI Button. |
Unity Event Invoke | Action is triggered when a specified UnityEvent is triggered. Note that it only works only on those that derive from UnityEvent and have a SerializeField attribute or be public. |
Timer | Action is triggered when the timer elapses |
None | There is no trigger for this Stage |
Key to Press
Shows up only when “Key Press” is selected as Trigger Type. Specifies which key must be pressed to activate the trigger.
Input Name
Shows up only when “Input” is selected as Trigger Type. Specifies which input must be pressed to activate the trigger. You can set up your own inputs in the Input Manager.
UGUI Button
Shows up only when “UGUI Button Click” is selected as Trigger Type. Specifies which UGUI Button (or any UI element with Button component assigned to it) should be listened to. Target UI element will have OnClick() event added to it, which in turn would activate the actions.
Source
Shows up only when “Unity Event Invoke” is selected as Trigger Type. Asks for a GameObject where target UnityEvent is stored. You will then be asked to locate and choose the UnityEvent in a drop-down menu. The menu will show only UnityEvents that are public and do not derive from UnityEvent<T>
.
Timer amount
Shows up only when “Timer” is selected as Trigger Type. Specify how long should timer last before activating the actions.
Activation delay
If the Trigger Type is not set to “Timer” or “None”, you can specify the delay before trigger is activated. This is quite useful if you don't want your player spamming the button and skipping the tutorial accidentally without properly reading the instructions for example.
OnDelayEnd()
UnityEvent which invokes actions when activation delay timer elapses. Useful if you want to provide visual feedback when the user can trigger actions (e.g., show “Continue” text after 2 seconds of delay).
OnTriggerActivate()
UnityEvent which invokes actions when trigger gets activated.
Additional Action
Additional action which is invoked after the OnTriggerActivate().
Type | Description |
---|---|
Play Next Stage | Goes to the next Stage of this Tutorial. If there are no more stages left, then Tutorial ends. |
Stop Tutorial | Stops this tutorial. |
Nothing | No additional action is done. |