Puzzle System
Search…
CorePuzzleTrigger
This is the core class for the Trigger elements. This means that the subclasses of this component also have all properties and methods that are present in here. Make use of it.

Default

The default trigger component should be used when you want to activate it manually within your own script/event.
The component has public methods that you can use for this purpose:
1
/// <summary>
2
/// The method that triggers the puzzle step. Active iff the type of the trigger is 'OnMessage'.
3
/// </summary>
4
public virtual void Trigger();
5
6
/// <summary>
7
/// Deactivates the triggering state manually.
8
/// </summary>
9
public virtual void UnTrigger();
Copied!
Note that now we are not talking about the inheritance now, but rather about the completely different script that handles an event that will activate the trigger. In this case, the only thing that this script would need to do is just call out the provided public methods (Trigger or UnTrigger).
The inspector view interface provides you with 3 fields:
    Allow Multiple Triggering -- is it allowed to trigger it multiple times? If set to 'true', it will be possible to trigger the object multiple times regardless of its state.
    OnTriggerEvent -- callback that happens whenever the trigger is activated.
    OnUnTriggerEvent -- callback that happens whenever the trigger is deactivated.

Inheritance

Last modified 2yr ago
Copy link