A downloadable package

Introduction

This prototype event system allows a programmer to subscribe delegates (functions/methods) to an event type. When an event is triggered, the functions subscribed to the event type are each invoked.


Concepts

  • Each delegate subscribed to the event system must parameterise the 'Jacobs.Events.IEventData' data type.
  • When an event is triggered, the type of event taking place is determined by the (System.Type) value of the parameter that derives the 'Jacobs.Events.IEventData' interface.
  • It is possible to initialise multiple instances of the event system; however, it is recommended that the developer uses the public 'Singleton' property when keeping a record of a single; instance for multiple scripts to utilise. A menu item under Extension/Event-System-Instance is available if a singleton is required before the start of a game.


Notice

Since this is a prototype, if you discover any bugs or unintended features, don't hesitate to comment so I can get to work on a fix. Thanks!

Download

Download
event_system.unitypackage 2 kB
Download
event_system.zip 3 kB

Install instructions

You can either download the Unity package and drag the file into the asset window to add it to your game or download, unzip and add the scripts manually.

Leave a comment

Log in with itch.io to leave a comment.