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.
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",
...
},
}
//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();
👤 Cory Leach
- Twitter: @coryleach
- Github: @coryleach
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator