Skip to main content

Class BaseEventService

Namespace: RealityCollective.ServiceFramework.Services

Base Event System that can be inherited from to give other system features event capabilities.

public abstract class BaseEventService : BaseServiceWithConstructor, IEventService, IService

Inheritance

object ← BaseServiceBaseServiceWithConstructorBaseEventService

Implements

IEventService, IService

Inherited Members

BaseService.ServiceGuid, BaseService.ServiceModules, BaseService.RegisterServiceModule(IServiceModule), BaseService.UnRegisterServiceModule(IServiceModule), BaseService.Name, BaseService.Priority, BaseService.IsEnabled, BaseService.Initialize(), BaseService.Start(), BaseService.Reset(), BaseService.Update(), BaseService.LateUpdate(), BaseService.FixedUpdate(), BaseService.Destroy(), BaseService.OnApplicationFocus(bool), BaseService.OnApplicationPause(bool), BaseService.IsServiceRegistered, BaseService.RegisterServiceModules, BaseService.Dispose(), BaseService.OnDispose(bool), BaseService.DestroyAllserviceModules()

Constructors

BaseEventService(string, uint, BaseProfile)

Constructor.

protected BaseEventService(string name, uint priority, BaseProfile profile)

Parameters

name string

The service display name.

priority uint

The service initialization priority.

profile BaseProfile

The service configuration profile.

Properties

EventListeners

List of event listeners that are registered to this event service.

public IReadOnlyList<GameObject> EventListeners { get; }

Property Value

IReadOnlyList<GameObject>

Methods

HandleEvent<T>(BaseEventData, EventFunction<T>)

The main function for handling and forwarding all events to their intended recipients.

public virtual void HandleEvent<T>(BaseEventData eventData, ExecuteEvents.EventFunction<T> eventHandler) where T : IEventSystemHandler

Parameters

eventData BaseEventData

Event data

eventHandler ExecuteEvents.EventFunction<T>

Event handler delegate

Type Parameters

T

Event handler interface type

Remarks

See: https://docs.unity3d.com/Manual/MessagingSystem.html for more information.

Register(GameObject)

Registers a GameObject to listen for events from this event service.

public virtual void Register(GameObject listener)

Parameters

listener GameObject

GameObject to add to EventListeners.

Unregister(GameObject)

Unregisters a GameObject from listening for events from this event service.

public virtual void Unregister(GameObject listener)

Parameters

listener GameObject

GameObject to remove from EventListeners.