Skip to content

Unity Service Locator with EntryPoint for simple and advanced architecture. Easy to install, easy to use. Improves developer experience, dependency organization, and application stability.

License

Notifications You must be signed in to change notification settings

cyberaslan/UnityServiceLocator-EntryPoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Service Locator with EntryPoint

How to use

  1. Add UnityServiceLocator to project
  2. Add AppEntry prefab to scene
  3. Specify any types in the list

helper Dont care if service is MonoBehaviour-inherited (instance will be created on scene automatically)

  1. Just use Get() to get your service: ServiceLocator.Get<ExampleService>();

Why UnityServiceLocator?

UnityServiceLocator contains an application initialization system that resolves important architectural issues:

  • Transparent service initialization order allows you to control the flow of application startup
  • Easier to resolve problems of service codependency
  • An exception of one of the services does not interrupt code execution and app launch!
  • Auto instancing of monobehaviour services without the need to use prefabs
  • Asynchronous initialization of services supported

Why Service Locator vs. Singleton?

Service locator is a powerful and simple architectural pattern that has a number of advantages over singleton:

  • Any type can be registered
  • No need to write "single instance validation" boilerplate code in each class
  • Any type can be unregistered, so the static object lifecycle can be temporary

About

Unity Service Locator with EntryPoint for simple and advanced architecture. Easy to install, easy to use. Improves developer experience, dependency organization, and application stability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages