Before we dive into the explanation of the different components, let’s talk about the design concept behind the whole package.
In the real world, you can place a bear trap. If you take a closer look at this trap is build up from different elements.
There are two blades to do the damage and root the animal to place. By itself, this is not much worse than a knife on the kitchen table. A spring mechanism that clashes the two blades together makes it dangerous. Finally, it has a pressure plate. The trap only activates when somebody steps on it.
We wanted to follow this approach with this package. We developed four base components to represent the different parts of the trap.
Trigger: the pressure plate from the bear trap example. This activates the trap, but it can also deactivate it or toggle between the two.
Trap: thematical representation of the trap which contains the mechanisms. From the example, this is the bear trap you place down.
Mechanism: These components define how the trap works (clashing the blades together).
Effect Handlers: When the two blades clashes, you can hear a metallic clang sound. You can use effect handlers to subscribe to certain mechanism events and play particles or audio clips.
You can find these components under the “Assets/RunemarkStudio/DeadlyDungeonTraps/Scripts” folder.
You can also access them from the Component menu under the Deadly Dungeon Traps option.