Documentation for the Unity C# Library
Loading...
Searching...
No Matches
The Event System

The most important part in project development, a system that is designed to easily create, modify, and control scripts in the editor.

Scenarios

The main system that controls all the scenarios in them is called StepManager, it is here that all the steps of the scenario are executed, the transition between them and the execution of their functions on interactable objects.

The scenarios in our implementation are a scriptable object file with a number of configurations.

When opening a scenario, we can add steps to it. Steps are actually a place where some function will be called and some action will be called on the objects that you specify in the step.

Note
It is important to note that all objects that interact in a scenario must be interactable (inherited from InteractableClass) and it must also be registered, just add RegisterItem to it.

To interact with the scenario, you need to follow these steps:

  1. Create a new game object
  2. Create a new сomponent to it that will be inherited from the InteractableObject class and attach to it
  3. Change the item id, this is the actual id of the object by which it is accessed by the StepManager from step list (see screenshot 1)
  4. Open steps list (Windows-PIXO)
  5. Add step and create new id for it in StepId field
  6. Add function step and choose the function you need, see StepFunction to find out the list of available functions or add your own function
  7. Add interactive objects to the items for actions list on which the function you need will be called (see screenshot 2)

To start the next step, add its id to the next steps list

See step 3 to see what the typical structure of a simple two step scenario looks like.

Note
It is important to note that for the step manager to work correctly, it is necessary that the step ends with the Grabbable_Or_Interact_Object function.
1
2
3