Alert! Due to maintenance issues, Assets will be uploaded on: TopGameAssets.com

Init(args)

This is a paid asset, but now you can download it totally free. However, please keep in mind that this package is only provided for studying or testing the product prior to purchasing it, not for business functions.

Overview :

Init(args) is a dependency injection solution for Unity, designed from the ground up to seamlessly blend in with the traditional Unity workflow that you are well-acquainted with.

Highlights:

  • Easier to create (just add an attribute).
  • Automatically delivered to all client components.
  • Services can easily make use of other services (without execution order issues).
  • Service arguments can be overridden for individual components when needed.
  • Supports loading from addressables, resources folders, and scenes.
  • Services can be replaced with mocks during unit tests.
  • The service system makes use of reflection, but only during initialization, after which accessing cached services is very fast.

Inspector Features:

  • Full interface support with an intuitive drag-and-drop and drop-down-based Inspector UI
  • Value providers are dynamic arguments, such as randomized values or references to runtime objects.
  • Null Argument Guard: Get warnings about missing arguments in edit mode and at runtime.
  • Cross-Scene References: Assign objects to fields from other scenes.
  • Service tag: Turn any component into a service from the context menu.

Code Features:

  • [Service] attribute: Easily create globally shared services that are automatically injected into clients.
  • AddComponent with arguments.
  • Instantiate with arguments.
  • New GameObject with components and arguments.
  • Smart Execution Order: Objects are initialized in order based on their dependencies to avoid execution order-related issues.
  • Null or NullOrInactive: easily test if an interface type variable contains a destroyed object.
  • Wrappers: Attach plain old C# objects to GameObjects.
  • Read-Only Support: Assign read-only fields and properties during initialization.
  • Also included: a demo scene with a fully functional example game!

Download Init-args v1.2.4 Latest Version


Leave a Comment