👋
Welcome to com.gameframe.serviceprovider
A simplified ServiceProvider implementation for use in Unity3D.
Provides singleton and transient services.
Does not do dependency graphs, property or constructor injection.
Kind of just a glorified singleton manager.
Install
Using UnityPackageManager (for Unity 2018.3 or later)
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
{
"dependencies": {
"com.gameframe.serviceprovider": "https://github.com/coryleach/UnityServiceProvider.git#1.0.0",
...
},
}
Quick Start
Add a Singleton Service and Get it
//In your game bootstrapper script
var myService = new MyService(); //MyService implements custom interface IMyService
ServiceCollection.Current.AddSingleton(myService);
...
//In some other script someplace
var myService = ServiceProvider.Current.Get<IMyService>();
myService.DoStuff();
Author
- Twitter: @coryleach
- Github: @coryleach
Show your support
Give a
This README was generated with