A downloadable Script

Download NowName your own price

Hey Unity devs, I've cooked up something pretty neat that I think you're gonna love. It's my brand-new Service Provider for Unity, and it's here to make your coding life a whole lot easier. Ever got tired of juggling instances all over your project? I hear you, and I've got the solution.

What's the Big Deal?

Alright, here's the scoop: my tool lets you access all sorts of services in your game without having to scatter instances left, right, and center. Need a TimeManager? Just pop in

TimeManager timeManager = ServiceProvider.GetService<TimeManager>(); 

And boom, you're set. No need to have an instance of each system flying through your code anymore.

Features:

  • Easy Access with a Single Line: Imagine being able to call upon any service you need with just one line of code. That's what we're talking about here. Whether it's a TimeManager, AudioManager, or any custom service you've dreamt up, it's all available at your fingertips. Just use GetService<YourServiceClassName>(), and you're golden.
  • Plug 'n Play Simplicity: Adding a new service? If it inherits from IService, you're all set. There's no complicated setup required. Define your service, make sure it plays nice with IService, and our ServiceProvider will take care of the rest. It automatically recognizes and makes your service available for use throughout your project.
  • Seamless Integration: The beauty of this setup is its simplicity. Your services become easily accessible from anywhere in your project, without the need to manually manage their instances. It streamlines your workflow, letting you focus on crafting awesome features rather than managing boilerplate code.
  • Flexibility and Scalability: As your project grows, so does your toolbox. Need to add or update services? No problem. The ServiceProvider adapts to your project's needs, making it easy to scale and modify your services without breaking a sweat.

I've included an example class just to get you started, but it's really that simple, just make your class inherit from IService and call it when necessary.

Download

Download NowName your own price

Click download now to get access to the following files:

ServiceProvider.cs 3 kB
TimeManager example class 577 bytes

Leave a comment

Log in with itch.io to leave a comment.