Skip to content

Interactions

MatthieuLPro edited this page Aug 23, 2021 · 4 revisions

Main logic

See diagram

The main logic is as follows: we have attached a specific interaction to the player, and when the player presses a button, it calls the specific interaction. This interaction is modified by an object outside of the player. By default the player has an interaction that does nothing.

We have 3 types of classes:

  • The interaction: Which has the role of doing something, it is mainly the consequence of a button pressed by the player.
  • The interaction launcher: Which has the role to call the interaction attached to the player.
  • The interaction trigger: Which has the role to update the interaction attached to the player.

How to add a new interaction

  1. Create the new interaction class:
  • With a "Call" method in the file Interaction.Dictionary.
  • Should inherit from the class InteractionCore.
  1. Create the new trigger class
  • With a "RemoveComponent" and "AddComponent" method in the file Interaction.Trigger.
  • Should inherit from the class TriggerCore.
Clone this wiki locally