We will entertain your mind, enhance your brain, expand your lifestyle.

Event and Delegate

In the 16th puzzle, we adopted a method to solve the puzzle in the player movement view instead of the puzzle dedicated view. It was necessary to prohibit movement to other places when solving this puzzle, and to set/remove movement restrictions at the start/end of the puzzle.

Conventionally, in the player movement view, only the completion event for the puzzle was received, and it was used to unlock the next stage (call a dedicated function for unlocking).

There is also a method of creating dedicated processing individually for the event of puzzle start / end, but we decided to make it a unified event processing.

For this reason, the process of calling a dedicated function of a dedicated component registered in the past has been changed to call an arbitrary function of an arbitrary component set in the inspector using UnityEvent. In the process of this change, some callback processing was required, and he also introduced a mechanism of Delegate.

Both UnityEvent and Delegate have been used in system packages, but this is the first time we have implemented them ourself.