Skip to main content

Interface IService

Namespace: RealityCollective.ServiceFramework.Interfaces

Generic interface for all Services

public interface IService

Properties

IsServiceRegistered

Is this service currently registered with the Service Manager?

bool IsServiceRegistered { get; }

Property Value

bool

Name

The service display name.

string Name { get; }

Property Value

string

Priority

Optional Priority to reorder registered managers based on their respective priority, reduces the risk of race conditions by prioritizing the order in which services are evaluated.

uint Priority { get; }

Property Value

uint

RegisterServiceModules

Should services modules be automatically registered for this Service and be maintained by the Service Framework, or are they managed internally by the Service itself.

bool RegisterServiceModules { get; }

Property Value

bool

ServiceGuid

Cached Guid Reference for the Service / Module

Guid ServiceGuid { get; }

Property Value

Guid

ServiceModules

List of Service Modules to be managed by a Service Implementation. Not to be used for Service Modules themselves.

IReadOnlyCollection<IServiceModule> ServiceModules { get; }

Property Value

IReadOnlyCollection<IServiceModule>

Methods

Destroy()

Optional Destroy function to perform cleanup of the service before the Service Manager is destroyed.

void Destroy()

FixedUpdate()

Optional FixedUpdate function to perform updates that are fixed to the Physics timestep.

void FixedUpdate()

Initialize()

The initialize function is used to setup the service once created. This method is called once all services have been registered in the ServiceManager.

void Initialize()

LateUpdate()

Optional LateUpdate function to perform updates after the end of the last Update cycle.

void LateUpdate()

OnApplicationFocus(bool)

Optional function that is called when the application gains or looses focus.

void OnApplicationFocus(bool isFocused)

Parameters

isFocused bool

OnApplicationPause(bool)

Optional function that is called when the application is paused or un-paused.

void OnApplicationPause(bool isPaused)

Parameters

isPaused bool

RegisterServiceModule(IServiceModule)

Register a Service Module with its parent service

void RegisterServiceModule(IServiceModule serviceModule)

Parameters

serviceModule IServiceModule

Reset()

Optional Reset function to perform that will Reset the service, for example, whenever there is a profile change.

void Reset()

Start()

The start function is used to for running on the first frame. This method is called once all services have been registered in the ServiceManager and the application is in play mode.

void Start()

UnRegisterServiceModule(IServiceModule)

UnRegister a Service Module with its parent service

void UnRegisterServiceModule(IServiceModule serviceModule)

Parameters

serviceModule IServiceModule

Update()

Optional Update function to perform per-frame updates of the service.

void Update()