ServiceProvider
ServiceProvider : Instance
Overview
ServiceProvider is an abstracted single-tone class that becomes the parent class of instances that provide the necessary services to manage the OVERDARE UGC.
Description
ServiceProvider manages and organizes Lua services by acting as a service provider for Lua scripts within the development environment. This class offers developers access to specific Lua instances through FindService() or GetService(), which help locate or retrieve desired instances based on their associated class names. By maintaining organization and communication between these services, OVERDARE Studio promotes a structured and efficient scripting process for users in its development platform.
Properties
Methods
FindService
This method is used to locate a service instance by its class name. If a service with the specified class name exists, it will return the corresponding instance; otherwise, it will return nil. The method ensures that developers can dynamically search for and interact with services registered within the ServiceProvider. |
Parameters
string
InClassName
Return
Instance
Code Samples
GetService
GetService is a method that retrieves a service instance by its class name. Unlike FindService, which may return nil if the specified service does not exist, GetService guarantees that the service will be provided. If the service is not already created, it will initialize the requested service and then return the instance. This ensures that developers always have access to the service they need for their Lua scripts, promoting robustness and reliability within the OVERDARE development platform.
Parameters
string
InClassName
Return
Instance