
Init(args) is a next-gen DI framework for Unity, that combines exceptional flexibility with unprecedented ease-of-use.What Is Init(args)?Init(args) is a straightforward and type-safe solution for providing your components with all the objects that they depend on.Here are some reasons why Init(args) could be the ideal choice to power the architecture of your next game…✅ It’s SimpleInit(args)'s Inspector and attribute-based workflow is incredibly intuitive – the basics can literally be learned in a matter of minutes.✅ It’s Inspector-IntegratedServices that clients will receive are visualized in the Inspector and support click-to-ping – just like you’re used to with serialized fields!✅ It’s DependableClients always receive the services they depend on before their Awake event – regardless of whether they’re loaded as part of a scene, instantiated from a prefab, or created using AddComponent.✅ It’s DebuggableForgot to register a service that is required by a client?Init(args) will display a warning box in the Inspector and log a warning to the Console in Edit Mode, and throw an exception and visualize unserialized state in the Inspector in Play Mode.And if everything else fails, there's even a Debugger window.✅ It’s Highly FlexibleGlobal and local services, full interface support, cross-scene references, value providers… don’t let Init(args)’s ease-of-use mislead you into thinking it’s lacking in the power department!✅ It’s Fast!The simple and type-safe injection pipelines at the heart of Init(args) don’t depend on reflection, IL post-processing or source generators, while delivering class-leading performance.Main FeaturesGlobal ServicesLocal ServicesFull Interface SupportCross-Scene ReferencesPrefab Instance ReferencesValue ProvidersWrappersNull Argument GuardInstantiate with argumentsAdd Component with argumentsCreate ScriptableObject with argumentsAsynchronous Initialization SupportDeferred Initialization SupportType-safe and reflection-free injectionLet Init(args) take care of all the dirty plumbing work, and allow yourself to fully focus on just creating a great game!Also Included: A demo scene contaning an example game!Links• Forum - Have any questions or ideas for new features? Discuss here.• Documentation - Online Documentation for Init(args).• Scripting Reference - Descriptions of all classes and class members in Init(args).Receive services via Init methodpublic class Player : MonoBehaviour{ private IInputManager inputManager; protected override void Init(IInputManager inputManager) { this.inputManager = inputManager; }}Instantiate with argumentsvar player = playerPrefab.Instantiate(inputManager);Add Component with argumentsvar player = gameObject.AddComponent(inputManager);Create ScriptableObject with argumentsvar dialogueAsset = Create.Instance(id);new GameObject with argumentsnew GameObject("Player").Init1(inputManager, Second.Component);Register Global Services[Service(typeof(IInputManager))]class InputManager : IInputManager[Service(ResourcePath = "Player")]class Player : MonoBehaviourWrappers - attach plain old class objects to GameObjectsvar player = new Player();gameObject.AddComponent(player);