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.

TypeDescription
Any Key PressAction is triggered by clicking any button on the keyboard.
Key PressAction is triggered by clicking a specific button on the keyboard.
InputAction is triggered by clicking an input.
UGUI Button ClickAction is triggered by clicking a UGUI Button.
Unity Event InvokeAction 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.
TimerAction is triggered when the timer elapses
NoneThere 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().

TypeDescription
Play Next StageGoes to the next Stage of this Tutorial. If there are no more stages left, then Tutorial ends.
Stop TutorialStops this tutorial.
NothingNo additional action is done.
  • tutorial-master/2.0/trigger.txt
  • Last modified: 2019/01/21 16:38
  • by admin