CorePuzzleHandler
Default
A default class of type Puzzle Handler. See Beginning -> Puzzle Structure for more info.
As it is has been described, this class is responsible for handling critical events of the puzzle lifespan: on puzzle solved and on puzzle failed.

To make your life easier, these events are easily assignable in the inspector view. Click '+' under the desired event, then select the object that you want to affect. Afterwards, in the appeared dropdown menu, choose the action that you want to apply to the object.
The class also declares a boolean property "debug" that will define whether or not, this specific puzzle system -- handler, logic and triggers within one puzzle -- will debug all logs into the console.
Inheritence
In order create more complex event callbacks, you can inherit CorePuzzleHandler.
There are 2 virtual methods available that you can overridde as you wish:
/// <summary>
/// The function that is triggered whenever the player has solved the puzzle.
/// </summary>
protected virtual void OnSolution() { }
/// <summary>
/// The function that is triggered whenever the player makes a mistake in solving the puzzle.
/// </summary>
protected virtual void OnFailure() { }
For example,
public class CustomPuzzleHandler : CorePuzzleHandler
{
protected override void OnSolution()
{
// Insert custom event
Debug.Log("Puzzle is solved!");
}
}
Last updated
Was this helpful?